# Annotation schema

| Attribute           | Data type                                        | Required   | Description                                                                                                                                                                                                                                                                                                                                      |
| ------------------- | ------------------------------------------------ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `type`              | string                                           | true       | Available values: `field`, `subtitl`e, `separator`                                                                                                                                                                                                                                                                                               |
| `key`               | string                                           | true       | Available values: `line_items`_,_ `tax_detail` or any valid field from [AnnotationMap](../document/#annotations-map)                                                                                                                                                                                                                             |
| `hidden`            | boolean                                          | false      | Either shows or hides field in the app. Hidden fields are NOT exported to ERPs                                                                                                                                                                                                                                                                   |
| `datatype`          | [Data Type](data-types.md)                       | true       | Field data type                                                                                                                                                                                                                                                                                                                                  |
| `message`           | string                                           | false      | Label of the this field                                                                                                                                                                                                                                                                                                                          |
| `hidden`            | boolean                                          | false      | Sets whether field is visible in annotation view and available for export to ERP                                                                                                                                                                                                                                                                 |
| `required`          | boolean                                          | false      | If set as required, this field must be filled in the app                                                                                                                                                                                                                                                                                         |
| `autofill`          | [AnnotationMap](../document/#annotations-map)\[] | false      | It is possible to autofill any annotation key from another one eg. `{"notes":  {"autofill": ["taxable_supply_date", "due_date"]}}` In this case we want to autofill the notes field with `taxable_supply_date`. In case there is no value in this case, `due_date` field is used.                                                                |
| `multivalue`        | boolean                                          | false      | Once set to `true` it shows multiple values per field. Eg. when having multiple bank accounts on a single invoice                                                                                                                                                                                                                                |
| `sectionMessageKey` | Enum                                             | true/false | This is used only for `subtitle` type fields and is mandatory in order to calculate correct order of items in schema. **MUST be unique for each subtitle field**. Possible values: `supplier_details`, `recipient_details`, `payment_details`, `header_registers`, `total_amounts`, `other_details`, `section_line_items`, `section_tax_details` |
| `separatorKey`      | string                                           | true/false | Required for separator type fields. **MUST be unique for each separator field.** Example: `separator-1`, `separator-2`, etc.                                                                                                                                                                                                                     |
| hideRegisterValue   | boolean                                          | false      | When `true` it hides the value of register item on FE. Eg. `{"value": "0001", "label": "Invoice"}` would be rendered as Invoice in the select only. When `false`, it would render as **0001 - Invoice**                                                                                                                                          |
| defaultValue        | string/number                                    | false      | Adds default value to field when it is not extracted by AI                                                                                                                                                                                                                                                                                       |
