> ## 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.

# Business Categories

## Overview

Retrieves all active business categories and their sub-categories from the API. Use this query to get the `businessCategoryId` and `businessSubCategoryId` values required for the **registerBusiness** mutation.

<br />

## Required scopes

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

<br />

## Parameters

This query does not require any parameters and does not support pagination

<br />

## Basic query structure

**Sample request:**

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

**Sample response:**

```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 />

## Response details

| Field                   | Type                    | Description                                        |
| ----------------------- | ----------------------- | -------------------------------------------------- |
| `businessCategoryId`    | `UUID`                  | Unique identifier for the business category        |
| `categoryName`          | `String`                | Name of the business category                      |
| `categoryDescription`   | `String`                | Description of the business category (may be null) |
| `businessSubCategories` | `[BusinessSubCategory]` | List of sub-categories within this category        |

<br />

### BusinessSubCategory

| Field                   | Type     | Description                                     |
| ----------------------- | -------- | ----------------------------------------------- |
| `businessSubCategoryId` | `UUID`   | Unique identifier for the business sub-category |
| `subCategoryName`       | `String` | Name of the sub-category                        |

<br />

## cURL Example

```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 />

***

## Notes

* Categories are sorted alphabetically by `categoryName`.
* Use the `businessCategoryId` and `businessSubCategoryId` values from this query when calling the `registerBusiness` mutation.
* The subcategory must be part of the chosen category to be valid during business registration.

***

<br />
