Order Status Service
Overview
Order Statuses represent the lifecycle stages of a sales order within the system.
They provide a consistent reference for:
- tracking order progress
- filtering and reporting
- workflow automation
- reporting and analytics
Order Statuses are tenant-scoped and managed independently. Changing or removing a status does not automatically modify related orders.
All operations are tenant-aware and scoped to the current tenant.
Endpoints
GET
/api/v1/OrderStatus/GetAllOrderStatuses
Returns all order statuses for the current tenant.
Behavior:
- Returns a list of all order statuses
- Returns
404if no statuses exist
Authorization:
- Requires Bearer Token
GET
/api/v1/OrderStatus/GetOrderStatusById/{id}
Returns a single order status by its numeric identifier.
Behavior:
- Looks up an order status by ID
- Returns
404if the status does not exist
Authorization:
- Requires Bearer Token
POST
/api/v1/OrderStatus/AddNewOrderStatus
Creates a new order status.
Request body:
Name(string, required)Weighting(int, optional)
Behavior:
- Validation is handled in the service layer
- Successful creation writes an audit log entry
Errors:
- Returns
400if validation -
Authorization:
- Requires Bearer Token
PUT
/api/v1/OrderStatus/UpdateOrderStatusById/{id}
Updates an existing order status.
Request body:
Name(string, required)Weighting(int, optional)
Behavior:
- ID is taken from the route
- Partial updates are not supported
- Successful update writes an audit log entry
Errors:
- Returns
400if validation - or status does not exist
Authorization:
- Requires Bearer Token
DELETE
/api/v1/OrderStatus/DeleteOrderStatusById/{id}
Deletes an order status 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 status does not exist or deletion -
Authorization:
- Requires Bearer Token
Notes
- Validation is enforced in the service layer
- Deleting a status does not cascade changes to orders
- All state-changing operations are audited
- Internal errors are logged but not exposed to clients