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

# Categorías de negocio

## Descripción general

Recupera todas las categorías de negocio activas y sus subcategorías desde la API. Usa esta consulta para obtener los valores `businessCategoryId` y `businessSubCategoryId` requeridos para la mutación **registerBusiness**.

<br />

## Alcances requeridos

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

<br />

## Parámetros

Esta consulta no requiere ningún parámetro y no admite paginación

<br />

## Estructura básica de la consulta

**Solicitud de ejemplo:**

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

**Respuesta de ejemplo:**

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

## Detalles de la respuesta

| Field                   | Type                    | Description                                             |
| ----------------------- | ----------------------- | ------------------------------------------------------- |
| `businessCategoryId`    | `UUID`                  | Identificador único de la categoría de negocio          |
| `categoryName`          | `String`                | Nombre de la categoría de negocio                       |
| `categoryDescription`   | `String`                | Descripción de la categoría de negocio (puede ser null) |
| `businessSubCategories` | `[BusinessSubCategory]` | Lista de subcategorías dentro de esta categoría         |

<br />

### BusinessSubCategory

| Field                   | Type     | Description                                       |
| ----------------------- | -------- | ------------------------------------------------- |
| `businessSubCategoryId` | `UUID`   | Identificador único de la subcategoría de negocio |
| `subCategoryName`       | `String` | Nombre de la subcategoría                         |

<br />

## Ejemplo con 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 />

***

## Notas

* Las categorías están ordenadas alfabéticamente por `categoryName`.
* Usa los valores `businessCategoryId` y `businessSubCategoryId` de esta consulta al llamar a la mutación `registerBusiness`.
* La subcategoría debe pertenecer a la categoría elegida para ser válida durante el registro del negocio.

***

<br />
