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
Returns all document types for the current tenant.
Response:
List<DocumentTypeModel>
Authorization:
- Requires Bearer Token
- Permission:
SettingsRead
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
Models
DocumentTypeModel
Fields:
Id (type: int)— internal identifierTitle (type: string?)— document type name (e.g. "Sales Order", "Quote")IsCredit (type: bool?)— marks this type as a credit documentDocumentPrefix (type: string?)— prefix used when generating order numbers (e.g. "SO", "QTE")DocumentNextNumber (type: long?)— the next sequence number to use for order number generationGuid (type: string?)— string code identifying this type (e.g."SALES_ORDER","QUOTE","PURCHASE_ORDER"). Used in the convert endpoints asdocumentTypeGuid
Notes
- Validation is enforced in the service layer
- All state-changing operations are audited
- Internal errors are logged but not exposed to clients
Guidis a business-level string code, not a UUID. It is used as thedocumentTypeGuidparameter in cart convert and document convert endpoints- Each document type has an internal
InitialStatusGuidconfiguration that determines the default document status assigned when a cart or document is converted to this type. If not set, the system falls back toNEW_ORDER