Brands Service
Overview
Brands represent product manufacturers or commercial brands used to classify and group products within the Catalog module.
They provide a consistent reference for:
- product identification
- filtering and search
- reporting and analytics
- brand-based merchandising
Brands are referenced by products but are managed independently. Removing a brand does not automatically modify related products.
All brand operations are tenant-aware and scoped to the current tenant.
Endpoints
GET
/api/v1/Brands
Returns a paginated, filterable list of brands.
Query parameters (pagination):
page(int, default: 1) - page number (1-based)pageSize(int, default: 20, max: 100) - items per pagesortBy(string, optional) - field to sort bysortDesc(bool, default: false) - sort descending
Query parameters (filters):
search(string, optional) - search across brand name and codeisActive(bool?, optional) - filter by active flag; omit for allbrandCode(string, optional) - filter by exact brand code
Response:
PagedResponse<BrandModel>
Authorization:
[AllowAnonymous]— no token required
GET
/api/v1/Brands/{id}
Returns a single brand by its numeric identifier.
Route parameters:
id(long, required) - brand identifier
Behavior:
- Returns
404if the brand does not exist
Response:
BrandModel
Authorization:
[AllowAnonymous]— no token required
GET
/api/v1/Brands/code/{code}
Returns a single brand by its unique code.
Route parameters:
code(string, required) - brand code
Behavior:
- Brand codes must be unique
- Returns
404if no brand matches the provided code
Response:
BrandModel
Authorization:
[AllowAnonymous]— no token required
POST
/api/v1/Brands
Creates a new brand.
Request body:
Name(string, required)Code(string, required)
Behavior:
- Validation is handled in the service layer
- Brand code must be unique
IsActiveis not explicitly set during creation and relies on database defaults- Successful creation writes an audit log entry
Errors:
- Returns
400if validation - or brand code already exists
Authorization:
- Requires Bearer Token
PUT
/api/v1/Brands/{id}
Updates an existing brand.
Request:
- Brand ID is taken from the route
- Body must include:
Name(string, required)Code(string, required)
- Optional:
IsActive(bool)
Behavior:
- Partial updates are not supported
- If
IsActiveis provided, it overwrites the existing value - Successful update writes an audit log entry
Errors:
- Returns
400if validation - or brand does not exist
Authorization:
- Requires Bearer Token
DELETE
/api/v1/Brands/{id}
Deletes a brand by its identifier.
Behavior:
- Performs a hard delete
- Record is permanently removed from the database
- Successful deletion writes an audit log entry
Errors:
- Returns
400if brand does not exist or deletion -
Authorization:
- Requires Bearer Token
Notes
- Validation is enforced in the service layer, not via model attributes
- Brand codes are expected to be unique
- Deleting a brand does not cascade changes to products
- All state-changing operations are audited
- Internal errors are logged but not exposed to clients