Product Categories
The ProductCategories entity is used to group products into hierarchical structures.
Fields
| Field | Type | Description |
|---|---|---|
id | Integer | Unique identifier (Primary Key). |
name | String | Human-readable name of the category. |
externalId | String | Identifier from external systems. |
company | Relation | The company this category belongs to. |
parent | Relation | Parent category for hierarchical structures. |
children | Relation[] | List of sub-categories. |
createdAt | DateTime | Metadata: Creation timestamp. |
updatedAt | DateTime | Metadata: Last update timestamp. |
Get List of Categories
Fetch a list of product categories with specified fields and filters.
Endpoint: POST /core/data/ProductCategories/select
Example Request:
json
{
"fields": {
"id": true,
"name": true,
"parent": { "id": true, "name": true },
"company": { "id": true }
},
"conditions": {
"operator": "and",
"filters": [
{
"field": "company.id",
"comparator": "=",
"value": 42
}
]
},
"orderBy": [
{
"field": "parent.name",
"order": "asc"
}
],
"limit": 100,
"offset": 0
}Get Single Category
Retrieve details for a specific category by ID.
Endpoint: POST /core/data/ProductCategories/select
Example Request:
json
{
"fields": {
"id": true,
"name": true,
"parent": { "id": true }
},
"conditions": {
"filters": [
{
"field": "id",
"comparator": "=",
"value": 10
}
]
},
"limit": 1
}Create Category
Create a new product category.
Endpoint: POST /core/data/ProductCategories/insert
Example Request:
json
{
"fields": [
{
"name": "Beverages",
"company": { "id": 42 },
"parent": { "id": 5 }
}
]
}Update Category
Update an existing product category.
Endpoint: POST /core/data/ProductCategories/update/{id}
Example Request:
json
{
"fields": {
"name": "Hot Beverages"
}
}Delete Categories
Remove one or more categories.
Endpoint: POST /core/data/ProductCategories/remove
Example Request:
json
{
"conditions": {
"operator": "and",
"filters": [
{
"field": "id",
"comparator": "in",
"value": [10, 11]
}
]
}
}