# Item

## Add Item

<mark style="color:green;">`POST`</mark> `http://15.165.197.67:5000/item`

이 엔드포인트에서는 아이템을 등록합니다.&#x20;

#### Headers

| Name  | Type   | Description                                                    |
| ----- | ------ | -------------------------------------------------------------- |
| token | string | Authentication token to track down who is emptying our stocks. |

#### Request Body

| Name     | Type   | Description                   |
| -------- | ------ | ----------------------------- |
| season   | array  | ex) season : \[sp, sm, f, w ] |
| image    | string |                               |
| type     | string |                               |
| category | string |                               |
| buydate  | string | 입력 데이터가 없을 시 null             |
| price    | number | 입력데이터가 없을 시 null              |
| brand    | string | 입력 데이터가 없을 시 null             |
| storage  | string | 입력 데이터가 없을 시 null             |

{% tabs %}
{% tab title="200  아이템 등록 성공   " %}

```
{    "message": "Successful",    "item_id": 44 }
```

{% endtab %}

{% tab title="403  토큰정보를 서버에서 확인할 수 없는 경우   " %}

```
{ "message": err.message }
```

{% endtab %}

{% tab title="404  아이템 등록 실패      " %}

```
{    "message": "Failed"    }
```

{% endtab %}
{% endtabs %}

## Update Item

<mark style="color:purple;">`PATCH`</mark> `http://15.165.197.67:5000/item/:item_id`

&#x20;이 엔드포인트에서는 아이템을 수정합니다.  변경하고자 하는 데이터 정보가 필요합니다. &#x20;

#### Path Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| item\_id | integer |             |

#### Headers

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| token | string |             |

#### Request Body

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| season   | array  |             |
| image    | string |             |
| type     | string |             |
| category | string |             |
| buydate  | string |             |
| price    | number |             |
| brand    | string |             |
| storage  | string |             |

{% tabs %}
{% tab title="200  아이템 수정 성공   " %}

```
{ "message": "Successful update item data with season" }
or
{ "message": "Successful update item data" }
```

{% endtab %}

{% tab title="403  토큰정보를 서버에서 확인할 수 없는 경우  " %}

```
{ "message": err.message }
```

{% endtab %}

{% tab title="404  아이템 수정 실패" %}

```
{"message": "Failed"}
```

{% endtab %}
{% endtabs %}

## Delete Item

<mark style="color:red;">`DELETE`</mark> `http://15.165.197.67:5000/item/:item_id`

이 엔드포인트에서는 아이템을 삭제합니다.

#### Path Parameters

| Name     | Type    | Description |
| -------- | ------- | ----------- |
| item\_id | integer |             |

#### Headers

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| token | string |             |

{% tabs %}
{% tab title="200  아이템 삭제 성공" %}

```
{ "message": "Successful" }
```

{% endtab %}

{% tab title="403 토큰정보를 서버에서 확인할 수 없는 경우 " %}

```
 { "message": err.message }
```

{% endtab %}

{% tab title="404  아이템 삭제 실패 " %}

```
{ "message": "Failed" }
```

{% endtab %}
{% endtabs %}
