Skip to content

Product Categories

The ProductCategories entity is used to group products into hierarchical structures.

Fields

FieldTypeDescription
idIntegerUnique identifier (Primary Key).
nameStringHuman-readable name of the category.
externalIdStringIdentifier from external systems.
companyRelationThe company this category belongs to.
parentRelationParent category for hierarchical structures.
childrenRelation[]List of sub-categories.
createdAtDateTimeMetadata: Creation timestamp.
updatedAtDateTimeMetadata: 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]
      }
    ]
  }
}