# Categories

## Retrieves a filtered list of categories.

**get** `/api/v2/public/categories`

Retrieves a filtered list of categories.

### Query Parameters

- `module_id: optional number`

  Optional module identifier to filter categories.

- `page_size: optional number`

  The number of results per page.

- `page_start: optional number`

  The page offset for pagination.

- `parent_category_code: optional string`

  Optional parent category code to filter by hierarchy.

- `search_text: optional string`

  Optional text to search categories by name.

### Example

```http
curl https://api.colleqtive.net/api/v2/public/categories \
    -H "Authorization: $COLLEQTIVE_BEARER_TOKEN"
```

## Creates or updates categories.

**post** `/api/v2/public/categories`

Creates or updates categories.

### Query Parameters

- `flush: optional boolean`

  When true, removes existing categories before inserting.

### Body Parameters

- `categories: optional array of object { category_name, is_adjust_min_max, is_markdown, 6 more }`

  The list of category entries.

  - `category_name: string`

    The category display name.

  - `is_adjust_min_max: boolean`

    Whether min/max stock levels should be automatically adjusted for products in this category.

  - `is_markdown: boolean`

    Whether markdown pricing is enabled for this category.

  - `category_code: optional string`

    Unique category code identifier.

  - `expiration_offset: optional number`

    Number of days offset for product expiration within this category.

  - `friendly_category_name: optional string`

    A user-friendly alternative name for the category.

  - `markdown_percentages: optional string`

    Comma-separated markdown percentage values.

  - `parent_category_code: optional string`

    The parent category code for hierarchy. Defaults to "0" (root) when not provided.

  - `receipt_offset: optional number`

    Number of days offset for receipt processing within this category.

### Returns

- `success: boolean`

  Indicates whether the operation completed successfully.

- `data: optional string`

  Optional data payload returned by the operation.

- `message: optional string`

  Human-readable message describing the result.

### Example

```http
curl https://api.colleqtive.net/api/v2/public/categories \
    -X POST \
    -H "Authorization: $COLLEQTIVE_BEARER_TOKEN"
```

#### Response

```json
{
  "success": true,
  "data": "data",
  "message": "message"
}
```

## Domain Types

### Category Create Categories Response

- `CategoryCreateCategoriesResponse object { success, data, message }`

  Standard success response returned by mutation endpoints.

  - `success: boolean`

    Indicates whether the operation completed successfully.

  - `data: optional string`

    Optional data payload returned by the operation.

  - `message: optional string`

    Human-readable message describing the result.
