Document Type Service
Overview
Document types define the classification of a document — e.g. Sales Order, Credit Note, Quote, Purchase Order.
They are referenced by every Document record via DocumentTypeId.
All operations are tenant-aware and scoped to the current tenant.
Endpoints
GET
/api/v1/DocumentTypes/{id}
Returns a single document type by its numeric identifier.
Route parameters:
id(int, required) - document type identifier
Behavior:
- Returns
404if not found
Response:
DocumentTypeModel
Authorization:
- Requires Bearer Token
POST
/api/v1/DocumentTypes
Creates a new document type.
Request body (DocumentTypeModel):
Title(string, required)IsCredit(bool?, optional) - marks the type as a credit document
Behavior:
- Validation is handled in the service layer
- Successful creation writes an audit log entry
Response:
201 Created—DocumentTypeModel
Authorization:
- Requires Bearer Token
PUT
/api/v1/DocumentTypes/{id}
Updates an existing document type.
Route parameters:
id(int, required) - document type identifier
Request body (DocumentTypeModel):
- All fields updated as provided
Behavior:
- Successful update writes an audit log entry
Response:
200 OK—DocumentTypeModel
Authorization:
- Requires Bearer Token
DELETE
/api/v1/DocumentTypes/{id}
Deletes a document type by its identifier.
Route parameters:
id(int, required) - document type identifier
Behavior:
- Performs a hard delete
- Successful deletion writes an audit log entry
Response:
204 No Content
Authorization:
- Requires Bearer Token
Notes
- Validation is enforced in the service layer
- All state-changing operations are audited
- Internal errors are logged but not exposed to clients