> For the complete documentation index, see [llms.txt](https://doc.blowhorn.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.blowhorn.com/api-docs/wms-inventory/pack-config.md).

# Pack Config

## Fetch Package Config

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

This api returns all or a set of **Package Config** 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 **Package Config** like 'Box of 25'  |
| id   | String | Blowhorn assigned/supplied integer unique id for the **Package Config** 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": 1,
    "previous": null,
    "next": 0,
    "result": [
        {
            "id": 61,
            "tracking_level_dict": {
                "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_date": "2022-04-29T14:09:33.047659+05:30",
            "modified_date": "2022-04-29T14:09:33.049242+05:30",
            "name": "Box of 200",
            "each_volume": 100,
            "each_weight": 750,
            "tag_volume": 1,
            "use_each_volume": true,
            "use_tag_volume": false,
            "uom": "cc",
            "created_by": 108434,
            "modified_by": null,
            "tracking_level": 4,
            "each_dimension": 3548619,
            "customer": 40082,
            "color": null
        }
    ]
}
```

{% 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 Package Config

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

This API is for creating new **Package Configs**.

#### 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 **Package Configs** for the client                                                                                                                                                                                                                                           |
| tracking\_level                        | Integer | <p><strong>Tracking Level</strong> unique id to used for this package config.</p><p><strong>Note:</strong> Either <strong>tracking\_level</strong> or <strong>tracking\_level\_name</strong> should be provided even both of them marked as optional.</p>                                                  |
| id                                     | Integer | An identifier will be randomly generated by Blowhorn. You can optionally override this ID, but the ID must be unique across all **Package Configs** in your account.                                                                                                                                       |
| tracking\_level\_name                  | String  | <p><strong>Tracking Level</strong> unique name to used for this package config.</p><p><strong>Note:</strong> Either <strong>tracking\_level</strong> or <strong>tracking\_level\_name</strong> should be provided even both of them marked as optional. This field is <strong>case-sensitive.</strong></p> |
| each\_volume                           | Integer | Package volume ?                                                                                                                                                                                                                                                                                           |
| each\_weight                           | Integer | Package weight ?                                                                                                                                                                                                                                                                                           |
| tag\_volume                            | Integer | Tag Volume ?                                                                                                                                                                                                                                                                                               |
| use\_each\_volume                      | Boolean | Flag to indicate to use 'each\_volume' attribute of the package                                                                                                                                                                                                                                            |
| use\_tag\_volume                       | Boolean | Flag to indicate to use 'tag\_volume' attribute of the package                                                                                                                                                                                                                                             |
| uom                                    | String  | Unit of weight or volume of the package. Ex: KG                                                                                                                                                                                                                                                            |
| each\_dimension                        | String  | This is the dimension of the package in the format of '\<Length>x\<breadth>x\<height> uom' ex: '10x10x10 cc'                                                                                                                                                                                               |
| color                                  | String  | Color of the package.                                                                                                                                                                                                                                                                                      |

{% tabs %}
{% tab title="200: OK Successful creation of Package Config" %}

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

{% endtab %}

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

```javascript
{
    "status": "FAIL",
    "message": "Package Config 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 Package Config

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

This API is for updating an existing **Package Config**. Any or all of the below mentioned attribute of the **Package Config** 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>Package Config</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>Package Config</strong>  that needs to be updated.</p> |
| name                  | String  | <p>Unique text identifier of the <strong>Package Config</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>Package Config</strong>  that needs to be updated.</p>                                       |
| tracking\_level       | Integer | <p><strong>Tracking Level</strong> unique id to used for this package config.</p><p><strong>Note:</strong> Either <strong>tracking\_level</strong> or <strong>tracking\_level\_name</strong> should be provided even both of them marked as optional.</p>                                                                                      |
| tracking\_level\_name | String  | <p><strong>Tracking Level</strong> unique name to used for this package config.</p><p><strong>Note:</strong> Either <strong>tracking\_level</strong> or <strong>tracking\_level\_name</strong> should be provided even both of them marked as optional. This field is <strong>case-sensitive.</strong></p>                                     |
| each\_volume          | Integer | Package volume                                                                                                                                                                                                                                                                                                                                 |
| each\_weight          | String  | Package weight                                                                                                                                                                                                                                                                                                                                 |
| uom                   | Integer | Unit of weight or volume of the package. Ex: KG                                                                                                                                                                                                                                                                                                |
| use\_each\_volume     | Boolean | Flag to indicate to use 'each\_volume' attribute of the package                                                                                                                                                                                                                                                                                |
| use\_tag\_volume      | Boolean | Flag to indicate to use 'tag\_volume' attribute of the package                                                                                                                                                                                                                                                                                 |
| tag\_volume           | Integer | Tag Volume                                                                                                                                                                                                                                                                                                                                     |
| each\_dimension       | String  | This is the dimension of the package in the format of '\<Length>x\<breadth>x\<height> uom' ex: '10x10x10 cc'                                                                                                                                                                                                                                   |
| color                 | String  | Color of the package                                                                                                                                                                                                                                                                                                                           |

{% tabs %}
{% tab title="200: OK Successful updation of Package Config" %}

```javascript
{
    "status": "PASS",
    "message": "Package Config Updated successfully."
}
```

{% endtab %}

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

```javascript
{
    "status": "FAIL",
    "message": "Package Config 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 Package Config | Schema " %}

```json
{
    "id": 2001
    "name": "Box of 200",
    "tracking_level": 1,
    "tracking_level_name": "Each",
    "each_volume": 100,
    "tag_volume": 1,
    "each_weight": 750,
    "uom": "KG",
    "use_each_volume": true,
    "use_tag_volume": false,
    "each_dimension": "10x10x10 cc",
    "color": "Grey"
}
```

{% endtab %}

{% tab title="Sample Create Package Config | Schema " %}

```json
{
    "id": 2001
    "name": "Box of 200",
    "tracking_level": 1,
    "tracking_level_name": "Each",
    "each_volume": 100,
    "tag_volume": 1,
    "each_weight": 750,
    "uom": "KG",
    "use_each_volume": true,
    "use_tag_volume": false,
    "each_dimension": 3548619,
    "color": "Grey"
}
```

{% endtab %}
{% endtabs %}
