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/GetAllBrands
Returns all brands filtered by active status.
Query parameters:
isActive(bool) - filter by active flag
Behavior:
- Returns only brands matching the provided
isActivevalue - Returns
404if no brands match the filter
Authorization:
- Requires Bearer Token
GET
/api/v1/Brands/GetBrandById/{id}
Returns a single brand by its numeric identifier.
Behavior:
- Looks up brand by ID
- Returns
404if the brand does not exist
Authorization:
- Requires Bearer Token
GET
/api/v1/Brands/GetBrandsByCode/{code}
Returns a single brand by its unique code.
Behavior:
- Looks up brand by
Code - Brand codes must be unique
- Returns
404if no brand matches the provided code
Authorization:
- Requires Bearer Token
POST
/api/v1/Brands/AddNewBrand
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/UpdateBrandById/{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/DeleteBrandById/{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