Tax Code Service
Overview
Tax Codes represent tax classifications applied to products and transactions.
They provide a consistent reference for:
- pricing calculations
- reporting and compliance
- tax reporting per jurisdiction
Tax codes are tenant-scoped and used across sales, inventory, and accounting modules.
All operations are tenant-aware and scoped to the current tenant.
Endpoints
GET
/api/v1/TaxCode/GetAllTaxCodes
Returns all tax codes for the current tenant.
Behavior:
- Returns a list of tax codes
- Returns
404if no tax codes exist
Authorization:
- Requires Bearer Token
GET
/api/v1/TaxCode/GetTaxCodeById/{id}
Returns a single tax code by its numeric identifier.
Behavior:
- Looks up a tax code by ID
- Returns
404if the tax code does not exist
Authorization:
- Requires Bearer Token
GET
/api/v1/TaxCode/GetTaxCodeByCode/{code}
Returns a single tax code by its unique code.
Behavior:
- Tax code strings must be unique per tenant
- Returns
404if no tax code matches
Authorization:
- Requires Bearer Token
POST
/api/v1/TaxCode/AddNewTaxCode
Creates a new tax code.
Request body:
Code(string, required)Description(string, required)RatePercent(decimal, required)IsActive(bool, optional)
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/TaxCode/UpdateTaxCodeById/{id}
Updates an existing tax code.
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 tax code does not exist
Authorization:
- Requires Bearer Token
DELETE
/api/v1/TaxCode/DeleteTaxCodeById/{id}
Deletes a tax code 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 tax code does not exist or deletion -
Authorization:
- Requires Bearer Token
Notes
- Validation is enforced in the service layer
- Tax codes are expected to be unique per tenant
- Deleting a tax code does not cascade changes
- All state-changing operations are audited
- Internal errors are logged but not exposed to clients