Sales Order Category Service
Overview
Sales order categories provide a grouping or classification layer on top of sales orders. They allow teams to segment orders for reporting, filtering, and operational workflows.
All operations are tenant-aware and scoped to the current tenant.
Endpoints
GET
/api/v1/SalesOrderCategories/{id}
Returns a single sales order category by its numeric identifier.
Behavior:
- Looks up category by
Id - Returns
404if not found
Authorization:
- Requires Bearer Token
GET ALL
/api/v1/SalesOrderCategories
Returns all sales order categories.
Behavior:
- Returns full list of categories ordered by
SortOrder - Returns
404if no categories exist
Authorization:
- Requires Bearer Token
POST
/api/v1/SalesOrderCategories
Creates a new sales order category.
Request body:
SalesOrderCategoryModel(required)
Behavior:
- Validates that
Nameis provided - Successful creation writes an audit log entry
Errors:
- Returns
400if validation fails
Authorization:
- Requires Bearer Token
PUT
/api/v1/SalesOrderCategories/{id}
Updates an existing sales order category.
Request:
- Route parameter:
id(numeric) - Body:
SalesOrderCategoryModel(with updated fields)
Behavior:
- Updates all editable fields
- Successful update writes an audit log entry
Errors:
- Returns
400if validation fails or category does not exist
Authorization:
- Requires Bearer Token
DELETE
/api/v1/SalesOrderCategories/{id}
Deletes a sales order category 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 category does not exist or deletion fails
Authorization:
- Requires Bearer Token
Notes
- Validation is enforced in the service layer, not via model attributes
- All state-changing operations are audited
- Internal errors are logged but not exposed to clients