**版本：202601**

# 查询商品分类列表

**GET** `/openapi/2026-01/categories`

返回店铺中所有商品分类的列表。

## 请求

**Query参数**

- `pid` uint64

  上级分类 ID；用于查询该分类下的子分类
- `ids` uint64[]

  待查询的分类 ID 列表。 示例：?ids=1001&ids=1002

## 响应

**200**

OK

**application/json**

**数据结构 | 示例**

**数据结构**

- `code` string

  错误码
- `message` string

  错误信息
- `data` object

  - `categories` object[]

    分类列表

    *   Array \[

    - `id` uint64

      分类 ID
    - `name` string

      分类名称
    - `pid` uint64

      上级分类 ID
    - `level` int32

      分类层级（如 `1` 表示一级分类）
    - `position` int32

      分类在同级中的排序位置
    - `path` string

      分类层级路径（从根分类到当前分类，例如 `服饰/上衣/T恤`）
    - `google_id` int32

      关联的 Google 分类 ID
    *   \]

```json
{
  "code": "string",
  "message": "string",
  "data": {
    "categories": [
      {
        "id": 0,
        "name": "string",
        "pid": 0,
        "level": 0,
        "position": 0,
        "path": "string",
        "google_id": 0
      }
    ]
  }
}
```
