> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gobl.org/llms.txt
> Use this file to discover all available pages before exploring further.

# CategoryDef

CategoryDef contains the definition of a general type of tax inside a region.

## Schema ID

`https://gobl.org/draft-0/tax/regime-def#/$defs/CategoryDef`

## Properties

| Title | Property | Type | Description |
| - | - | - | - |
| Code | `code` | [cbc.Code](https://docs.gobl.org/draft-0/cbc/code.md) | Code to be used in documents. |
| Name | `name` | [i18n.String](https://docs.gobl.org/draft-0/i18n/string.md) | Short name of the category to be used instead of the code in output. |
| Title | `title` | [i18n.String](https://docs.gobl.org/draft-0/i18n/string.md) | Human readable name of the category used for titles. |
| Description | `desc` | [i18n.String](https://docs.gobl.org/draft-0/i18n/string.md) | Useful description of the category. |
| Retained | `retained` | boolean | When true, the tax amount will be retained by the buyer on behalf of the supplier, and thus subtracted from the invoice taxable base total. Typically used for taxes related to income. |
| Informative | `informative` | boolean | When true, the tax amount will be calculated and reported but will not affect the invoice totals. Typically used for taxes that are embedded in the base amount or don't impact the final payable amount. |
| Keys | `keys` | array of [tax.KeyDef](https://docs.gobl.org/draft-0/tax/key_def.md) | Specific tax definitions inside this category. |
| Rates | `rates` | array of [tax.RateDef](https://docs.gobl.org/draft-0/tax/rate_def.md) | Set of rates that can be used with this category. |
| Extensions | `extensions` | array of [cbc.Key](https://docs.gobl.org/draft-0/cbc/key.md) | Extension keys that may be used or required as an alternative to or alongside a rate for the tax category. Every key must be defined in the regime's extensions table. |
| Map | `map` | [cbc.CodeMap](https://docs.gobl.org/draft-0/cbc/code_map.md) | Regime specific code mappings. |
| Sources | `sources` | array of [cbc.Source](https://docs.gobl.org/draft-0/cbc/source.md) | List of sources for the information contained in this category and most importantly, an official source where the tax rates can be reviewed and updated in the future. |
| Extensions | `ext` | [tax.Extensions](https://docs.gobl.org/draft-0/tax/extensions.md) | Extension key-value pairs that will be copied to the tax combo if this category is used. |
| Meta | `meta` | [cbc.Meta](https://docs.gobl.org/draft-0/cbc/meta.md) | Additional information about the category that is relevant for local frequently used formats. |

## Validation Rules

| Field | Test | Validation Code / Message |
| - | - | - |
| CategoryDef | <ul><li>!Retained \|\| !Informative</li></ul> | `GOBL-TAX-CATEGORYDEF-04` Category def cannot be retained and informative |
| `code` | <ul><li>Present</li></ul> | `GOBL-TAX-CATEGORYDEF-01` Category def code is required |
| `name` | <ul><li>Present</li></ul> | `GOBL-TAX-CATEGORYDEF-02` Category def name is required |
| `title` | <ul><li>Present</li></ul> | `GOBL-TAX-CATEGORYDEF-03` Category def title is required |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.