## 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"
}
```
