Skip to content
Get started

Create or Update Categories

categories.create_categories(CategoryCreateCategoriesParams**kwargs) -> CategoryCreateCategoriesResponse
POST/api/v2/public/categories

Creates or updates product categories, matched on category_code. Categories can be nested by setting parent_product_category_code. Setting flush to true deletes all existing categories first, so only use it when sending the complete set.

ParametersExpand Collapse
flush: Optional[bool]

When true, removes existing categories before inserting.

categories: Optional[Iterable[Category]]

The list of category entries.

category_name: str

The category display name.

minLength1
is_adjust_min_max: bool

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

is_markdown: bool

Whether markdown pricing is enabled for this category.

category_code: Optional[str]

Unique category code identifier.

expiration_offset: Optional[int]

Number of days offset for product expiration within this category.

formatint32
friendly_category_name: Optional[str]

A user-friendly alternative name for the category.

markdown_percentages: Optional[str]

Comma-separated markdown percentage values.

parent_category_code: Optional[str]

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

receipt_offset: Optional[int]

Number of days offset for receipt processing within this category.

formatint32
ReturnsExpand Collapse
class CategoryCreateCategoriesResponse: …

Standard success response returned by mutation endpoints.

success: bool

Indicates whether the operation completed successfully.

data: Optional[str]

Optional data payload returned by the operation.

message: Optional[str]

Human-readable message describing the result.

Create or Update Categories

import os
from colleqtive_sdk import Colleqtive

client = Colleqtive(
    bearer_token=os.environ.get("COLLEQTIVE_BEARER_TOKEN"),  # This is the default and can be omitted
)
response = client.categories.create_categories()
print(response.success)
{
  "success": true,
  "data": "data",
  "message": "message"
}
{
  "code": 401,
  "status": "error",
  "message": "Authentication failed.",
  "error": "unauthorized",
  "error_description": "Authentication failed."
}
{
  "code": 500,
  "status": "fail",
  "message": "The request could not be processed.",
  "error": "internal_error",
  "error_description": "The request could not be processed."
}
Returns Examples
{
  "success": true,
  "data": "data",
  "message": "message"
}
{
  "code": 401,
  "status": "error",
  "message": "Authentication failed.",
  "error": "unauthorized",
  "error_description": "Authentication failed."
}
{
  "code": 500,
  "status": "fail",
  "message": "The request could not be processed.",
  "error": "internal_error",
  "error_description": "The request could not be processed."
}