# Categories

## Delete category

<mark style="color:red;">`DELETE`</mark> `https://api.woowup.com/apiv3/categories`

Delete a parent category and their childs

#### Request Body

| Name       | Type   | Description                       |
| ---------- | ------ | --------------------------------- |
| code       | string | Category code                     |
| notify\_to | string | email to receive the confirmation |

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

```javascript
{
    "payload": {
        "request_id": "xxxx"
    },
    "message": "ok",
    "code": "ok",
    "time": "62ms"
}
```

{% endtab %}

{% tab title="400 " %}

```javascript
{
    "payload": {
        "errors": [
            "Required properties missing: [\"code\"]"
        ]
    },
    "message": "bad request",
    "code": "bad_request",
    "time": "57ms"
}
```

{% endtab %}

{% tab title="403 " %}

```javascript
{
    "payload": [],
    "message": "forbidden: authentication failed",
    "code": "forbidden",
    "time": "7ms"
}
```

{% endtab %}

{% tab title="404 " %}

```javascript
{
    "payload": {
        "errors": [
            "category not found"
        ]
    },
    "message": "category not found",
    "code": "not_found",
    "time": "114ms"
}
```

{% endtab %}

{% tab title="500 " %}

```javascript
{
    "payload": [],
    "message": "",
    "code": "internal_error",
    "time": "72ms"
}
```

{% endtab %}
{% endtabs %}

**Example**

```bash
curl -X DELETE \
  https://api.woowup.com/apiv3/categories \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic XXXXXXXXXXXXXXXXXXXX' \
  -H 'Content-Type: application/json' \
  -d '{
	"code": "abcd",
	"notify_to": "test@email.com"
}'
```

**Response**

```javascript
{
    "payload": {
        "request_id": "XXXX"
    },
    "message": "ok",
    "code": "ok",
    "time": "62ms"
}
```

## Delete categories (bulk)

<mark style="color:red;">`DELETE`</mark> `https://api.woowup.com/apiv3/categories/bulk`

Delete all categories

#### Request Body

| Name       | Type   | Description                       |
| ---------- | ------ | --------------------------------- |
| notify\_to | string | email to receive the confirmation |

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

```javascript
{
    "payload": {
        "request_id": "xxxx"
    },
    "message": "ok",
    "code": "ok",
    "time": "62ms"
}
```

{% endtab %}

{% tab title="403 " %}

```javascript
{
    "payload": [],
    "message": "forbidden: authentication failed",
    "code": "forbidden",
    "time": "7ms"
}
```

{% endtab %}

{% tab title="500 " %}

```javascript
{
    "payload": [],
    "message": "",
    "code": "internal_error",
    "time": "72ms"
}
```

{% endtab %}
{% endtabs %}

**Example**

```bash
curl -X DELETE \
  https://api.woowup.com/apiv3/categories/bulk \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic XXXXXXXXXXXXXXXXXXXX' \
  -H 'Content-Type: application/json' \
  -d '{
	"notify_to": "test@email.com"
}'
```

**Response**

```javascript
{
    "payload": {
        "request_id": "XXXX"
    },
    "message": "ok",
    "code": "ok",
    "time": "62ms"
}
```
