> 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-inbound/clients.md).

# Clients

Client is the inventory owner for all the stock in the warehouse

## Fetch details of Client

<mark style="color:blue;">`GET`</mark> `/wms/client`

Use this API to get the details of the Client(s). Below mentioned filters can be used to filter to get a single or set of client objects. If multi filters are used then all will be used for matching the result.

#### Query Parameters

| Name        | Type   | Description                                                        |
| ----------- | ------ | ------------------------------------------------------------------ |
| id          | String | Client id returned by the Blowhorn at the time of client creation. |
| description | String | Full or partial description text of the client                     |
| name        | String | Full or partial name of the client.                                |

#### Headers

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

{% tabs %}
{% tab title="200 Successful result with or without filter" %}

```json
{
    "count": 1,
    "previous": null,
    "next": 0,
    "result": [
        {
            "id": 4,
            "created_date": "2021-07-30T17:37:55.864539+05:30",
            "modified_date": "2021-07-30T17:37:55.865651+05:30",
            "name": "Default Client",
            "description": "Default Client",
            "created_by": 108434,
            "modified_by": 108434,
            "customer": 40082
        }
    ]
}
```

{% endtab %}

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

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

{% endtab %}

{% tab title="500 Unexpected error" %}

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

{% endtab %}

{% tab title="200: OK When no client matches the filter criteria" %}

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

{% endtab %}
{% endtabs %}

## Create a Client

<mark style="color:green;">`POST`</mark> `/wms/client`

Use this API to create client on the blowhorn systems.

#### 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 | Name of the client        |
| description                            | String | Description of the client |

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

```javascript
{
    "status": "FAIL",
    "message": "Client name should be unique."
}
```

{% endtab %}

{% tab title="200: OK Successful Creation" %}

```javascript
{
    "status": "PASS",
    "message": {
        "id": 221,
        "name": "Client account default",
        "description": "Deault client account for abc corp."
    }
}
```

{% 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 %}
{% endtabs %}

{% tabs %}
{% tab title="Example Schema 01" %}

```json
{
    "name": "Default Client for ABC Corp 01",
    "description": "Default Client for ABC Corp 01"
}
```

{% endtab %}

{% tab title="Example Schema 02" %}

```json
{
    "name": "Default Client for ABC Corp 01"
}
```

{% endtab %}
{% endtabs %}
