---
# System prepended metadata

title: API Details - VendorCategory
tags: [API Details]

---

# API Details - VendorCategory
###### tags: `API Details`

## 取得所有賣場分類

### query 參數：
- `_page` 頁數，預設為 1
- `_limit` 查詢筆數，預設為 10
- `_sort` 依...排序，預設為 'id'，另可輸入 'name'
- `_order` 正序/反序，預設為 'DESC'，另可輸入 'ASC'

### Response Example

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

## 取得單一賣場分類

### Response Example

```json
{
    "ok": 1,
    "data": {
        "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"
}
```
