# Warehouse

## Get Warehouses

<mark style="color:blue;">`GET`</mark> `https://open-api.zortout.com/v4/Warehouse/GetWarehouses`

Get list of warehouses/branches.

#### Query Parameters

| Name  | Type | Description                |
| ----- | ---- | -------------------------- |
| page  | Int  | Page (Default = 1)         |
| limit | Int  | Limit per page (Max = 500) |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

{% tabs %}
{% tab title="Response" %}

| Parameter | Type              | Description/Example                   |
| --------- | ----------------- | ------------------------------------- |
| res       | Response          | <p>Response Code <br>200- Success</p> |
| list      | Warehouse (Array) | Warehouse List(Array)                 |
| count     | Int               | Total warehouse number by filter      |

| Warehouse (Array) | Type   | Description/Example |
| ----------------- | ------ | ------------------- |
| id                | Int    | Warehouse ID        |
| name              | String | Warehouse Name      |
| code              | String | Warehouse Code      |
| address           | String | Warehouse Addressr  |
| {% endtab %}      |        |                     |
| {% endtabs %}     |        |                     |

## Add Warehouse

<mark style="color:green;">`POST`</mark> `https://open-api.zortout.com/v4/Warehouse/AddWarehouse`

Add warehouse/branch.

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| storename<mark style="color:red;">\*</mark> | String | Store Name  |
| apikey<mark style="color:red;">\*</mark>    | String | API Key     |
| apisecret<mark style="color:red;">\*</mark> | String | API Secret  |

#### Request Body

| Name                                   | Type   | Description       |
| -------------------------------------- | ------ | ----------------- |
| code<mark style="color:red;">\*</mark> | String | Warehouse Code    |
| name<mark style="color:red;">\*</mark> | String | Warehouse Name    |
| address                                | String | Warehouse Address |

{% tabs %}
{% tab title="Response" %}

| Parameter | Type   | Description/Example                   |
| --------- | ------ | ------------------------------------- |
| resCode   | String | <p>Response Code <br>200- Success</p> |
| resDesc   | String | Response Description                  |
| detail    | Detail | Detail                                |

| Detail       | Type | Description/Example |
| ------------ | ---- | ------------------- |
| id           | Int  | Warehouse ID        |
| {% endtab %} |      |                     |

{% tab title="Ex. Request JSON" %}

```json
{
  "code": "W0001",
  "name": "Warehouse1"
}
```

{% endtab %}
{% endtabs %}
