Product Category Service

Back to Catalog

Overview

The Product Category module manages the many-to-many relationship between Products and Categories.

It defines how products are assigned to categories and enables:

This module does not manage category definitions or product data itself. It only manages the relationship between them.

The join table (catalog.ProductCategory) is an explicit EF entity with its own DbSet, enabling direct, efficient queries without loading full Product or Category objects.

All operations are tenant-aware and fully audited.


Endpoints

Back to Catalog

GET

/api/v1/ProductCategories/category/{categoryId}

Returns a list of product IDs assigned to a given category.

Route parameters:

Behavior:

Response:

Authorization:


GET

/api/v1/ProductCategories/product/{productId}

Returns a list of category IDs assigned to a given product.

Route parameters:

Behavior:

Response:

Authorization:


POST

/api/v1/ProductCategories/product/{productId}

Assigns one or more categories to a product in a single request.

Route parameters:

Request body:

Behavior:

Errors:

Response:

Authorization:


DELETE

/api/v1/ProductCategories/product/{productId}

Removes categories from a product. Behaviour depends on the request body.

Route parameters:

Request body:

Behavior:

Response:

Authorization:


DELETE

/api/v1/ProductCategories/category/{categoryId}

Removes all products from a specific category.

Route parameters:

Behavior:

Response:

Authorization:


Notes