---
# System prepended metadata

title: API Detail - ProductCategory
tags: [API Details]

---

API Detail - ProductCategory
===
###### tags: `API Details`

## 取得所有商品分類

### Response Example

```json
{
    "ok": 1,
    "data": [
        {
            "id": 1,
            "name": "category1"
        },
        {
            "id": 2,
            "name": "category2"
        }
    ]
}
```

## 新增商品分類

### Request Example

```json
{
  "name": "category name"
}
```

### Response Example
```json
{
    "ok": 1,
    "message": "Success"
}
```

## 編輯商品分類

### Request Example

```json
{
  "name": "category name"
}
```

### Response Example
```json
{
    "ok": 1,
    "message": "Success"
}
```

## 刪除商品分類

### Response Example
```json
{
    "ok": 1,
    "message": "Success"
}
```
