Unit of Measure Service
Overview
Units of Measure (UOM) define standardized measurement units for products and inventory.
They provide a consistent reference for:
- product quantification
- inventory management
- pricing and conversions
- reporting and analytics
Units of Measure are tenant-scoped and used across sales, inventory, and purchasing modules.
All operations are tenant-aware and scoped to the current tenant.
Endpoints
GET
/api/v1/UnitOfMeasure/GetAllUnitOfMeasures
Returns all units of measure for the current tenant.
Behavior:
- Returns a list of UOMs
- Returns
404if no units exist
Authorization:
- Requires Bearer Token
GET
/api/v1/UnitOfMeasure/GetUnitOfMeasureById/{id}
Returns a single unit of measure by its numeric identifier.
Behavior:
- Looks up a unit by ID
- Returns
404if the unit does not exist
Authorization:
- Requires Bearer Token
GET
/api/v1/UnitOfMeasure/GetUnitOfMeasureByCode/{code}
Returns a single unit of measure by its unique code.
Behavior:
- UOM codes must be unique per tenant
- Returns
404if no unit matches
Authorization:
- Requires Bearer Token
POST
/api/v1/UnitOfMeasure/AddNewUnitOfMeasure
Creates a new unit of measure.
Request body:
Code(string, required)Name(string, required)
Behavior:
- Validation is handled in the service layer via
IsReadyToAdd() - Successful creation writes an audit log entry
Errors:
- Returns
400if validation -
Authorization:
- Requires Bearer Token
PUT
/api/v1/UnitOfMeasure/UpdateUnitOfMeasureById/{id}
Updates an existing unit of measure.
Request body:
- Same fields as POST
Behavior:
- ID is taken from the route
- Partial updates are not supported
- Successful update writes an audit log entry
Errors:
- Returns
400if validation - or unit does not exist
Authorization:
- Requires Bearer Token
DELETE
/api/v1/UnitOfMeasure/DeleteUnitOfMeasureById/{id}
Deletes a unit of measure by its ID.
Behavior:
- Performs a hard delete
- Record is permanently removed from the database
- Successful deletion writes an audit log entry
Errors:
- Returns
400if unit does not exist or deletion -
Authorization:
- Requires Bearer Token
Notes
- Validation is enforced in the service layer
- UOM codes are expected to be unique per tenant
- Deleting a unit does not cascade changes
- All state-changing operations are audited
- Internal errors are logged but not exposed to clients