Tax Codes
Tax codes define how taxes are calculated and applied to invoice line items in the billing system. Each tax code contains a rate, validity period, and references to accounting accounts for proper financial posting. The system uses tax codes to automatically calculate tax amounts on invoices based on the configured rate and applies them consistently across all billing operations.
Properties
| Property | Type | Description |
|---|---|---|
id | GUID | Unique identifier |
code | string | Short code identifier |
name | string | Display name |
description | string | Detailed description |
rate | decimal | Tax rate percentage (e.g., 19.00) |
taxType | string | VAT, Sales Tax, or Exempt |
taxAccountId | GUID | Account for tax posting |
revenueAccountId | GUID | Account for revenue posting |
validFrom | date | Effective start date |
validTo | date | Expiration date (optional) |
isActive | boolean | Active status |
API Endpoints
GET /tax-codes
GET /tax-codes/{id}
Response Example
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"code": "VAT19",
"name": "Standard VAT 19%",
"description": "Standard value-added tax rate",
"rate": 19.00,
"taxType": "VAT",
"taxAccountId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"revenueAccountId": "8d7f9e8a-8536-41fe-a53c-3d874bf2c9d1",
"validFrom": "2024-01-01T00:00:00Z",
"validTo": null,
"isActive": true
}
Usage in Invoices
When an invoice line item is created, the tax code determines how tax is calculated and posted. The system copies the tax rate to the line item as a snapshot, ensuring historical accuracy even if the tax code changes later. Tax amounts are calculated using the formula: netAmount × (taxRate / 100). The tax account specified in the tax code is used for journal posting when the invoice is finalized.