Category Service

Back

Overview

Categories are used to organize products into logical hierarchies. They support parent-child relationships and are used for navigation, filtering, reporting and merchandising.

Categories can optionally include their associated products when retrieved, filtered by entity access permissions.

All category operations are tenant-aware and scoped to the current tenant.


Endpoints

Back to Catalog

GET

/api/v1/Categories/{id}

Returns a single category by its numeric identifier.

Query parameters:

Behavior:

Response:

Authorization:


GET

/api/v1/Categories/code/{code}

Returns a single category by its unique code.

Query parameters:

Behavior:

Response:

Authorization:


GET

/api/v1/Categories/slug/{slug}

Returns a single category by its SEO-friendly slug.

Query parameters:

Behavior:

Response:

Authorization:


GET

/api/v1/Categories

Returns all categories filtered by parent and active status.

Query parameters:

Behavior:

Authorization:


POST

/api/v1/Categories

Creates a new category.

Request body:

Behavior:

Errors:

Authorization:


PUT

/api/v1/Categories/{id}

Updates an existing category.

Request:

Behavior:

Errors:

Authorization:


DELETE

/api/v1/Categories/{id}

Deletes a category by its identifier.

Behavior:

Errors:

Authorization:


Product Filtering

When showProducts=true is specified on GET endpoints, the following applies:

Access Control

Filtering Rules

Performance Optimization

Product data is loaded efficiently to prevent N+1 query problems using 4 optimized queries:

  1. Find product IDs (category + entity access filter)
  2. Load product basic data with projection
  3. Bulk load all stock items for found products
  4. Bulk load all properties for found products
  5. In-memory grouping and assignment

Response Structure

Products include complete details: SKU, Title, Description, Summary, Active status, Brand name, Tax Code, Unit Price, Stock Items (per warehouse with QuantityOnHand and QuantityAllocated), and Properties (Name/Value pairs).


Notes