> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fluz.app/llms.txt
> Use this file to discover all available pages before exploring further.

# 业务类别

## 概览

从 API 检索所有有效的业务类别及其子类别。使用此查询获取 **registerBusiness** 变更所需的 `businessCategoryId` 和 `businessSubCategoryId` 值。

<br />

## 所需权限范围

| Property        | Value               |
| :-------------- | :------------------ |
| Endpoint        | GraphQL API         |
| Authentication  | OAuth Bearer Token  |
| Required Scopes | `REGISTER_BUSINESS` |

<br />

## 参数

此查询不需要任何参数，且不支持分页

<br />

## 基本查询结构

**示例请求：**

```graphql theme={null}
query GetBusinessCategories {
  getBusinessCategories {
    businessCategoryId
    categoryName
    categoryDescription
    businessSubCategories {
      businessSubCategoryId
      subCategoryName
    }
  }
}
```

**示例响应：**

```json json theme={null}
{
  "data": {
    "getBusinessCategories": [
      {
        "businessCategoryId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "categoryName": "Retail Trade",
        "categoryDescription": "Businesses engaged in selling merchandise to consumers",
        "businessSubCategories": [
          {
            "businessSubCategoryId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
            "subCategoryName": "E-commerce"
          },
          {
            "businessSubCategoryId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
            "subCategoryName": "Brick and Mortar Retail"
          }
        ]
      },
      {
        "businessCategoryId": "d4e5f6a7-b8c9-0123-defg-234567890123",
        "categoryName": "Professional Services",
        "categoryDescription": "Businesses providing professional or consulting services",
        "businessSubCategories": [
          {
            "businessSubCategoryId": "e5f6a7b8-c9d0-1234-efgh-345678901234",
            "subCategoryName": "Consulting"
          },
          {
            "businessSubCategoryId": "f6a7b8c9-d0e1-2345-fghi-456789012345",
            "subCategoryName": "Legal Services"
          }
        ]
      }
    ]
  }
}
```

<br />

## 响应详情

| Field                   | Type                    | Description      |
| ----------------------- | ----------------------- | ---------------- |
| `businessCategoryId`    | `UUID`                  | 业务类别的唯一标识符       |
| `categoryName`          | `String`                | 业务类别名称           |
| `categoryDescription`   | `String`                | 业务类别描述（可能为 null） |
| `businessSubCategories` | `[BusinessSubCategory]` | 此类别下的子类别列表       |

<br />

### BusinessSubCategory

| Field                   | Type     | Description |
| ----------------------- | -------- | ----------- |
| `businessSubCategoryId` | `UUID`   | 业务子类别的唯一标识符 |
| `subCategoryName`       | `String` | 子类别名称       |

<br />

## cURL 示例

```bash theme={null}
curl -X POST https://transactional-graph.staging.fluzapp.com/api/v1/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -d '{
    "query": "query GetBusinessCategories { getBusinessCategories { businessCategoryId categoryName categoryDescription businessSubCategories { businessSubCategoryId subCategoryName } } }"
    }'
```

<br />

***

## 说明

* 类别按 `categoryName` 的字母顺序排序。
* 调用 `registerBusiness` 变更时，使用此查询返回的 `businessCategoryId` 和 `businessSubCategoryId` 值。
* 在企业注册过程中，所选子类别必须隶属于所选类别，方为有效。

***

<br />
