# Categories

Group products, and optionally collect extra details on their tags.


A category groups products that share the same extra details. A product
belongs to one category at most, and it can belong to none. Pick the category
when you create the product. Its fields appear on the form with the right
input for each type, such as a country list or a date picker. The values are
stored with every tag of the product.

A category can have no fields. It then only records which products belong to
it.

Categories have their own place in the sidebar, next to Products and Entities:
**[Categories](/dashboard/categories)**.

See [products, categories, and entities](/docs/dashboard/concepts) for how the
three fit together.

## Why categories

Custom data on a tag used to mean writing JSON by hand (see
[custom data](/docs/dashboard/custom-data)). A category turns that into a
form. Everyone on the team fills in the same fields, spelled the same way, and
the form suggests values other tags already carry.

## Fields

Each field has a label, a type, and an optional default. The type decides the
input on the product form and how the value is stored:

- **Text** and **Multiline Text**: free text, up to 1,000 and 10,000
  characters. When other tags already carry values for the field, the form
  suggests them while you type.
- **Email**, **Phone**, and **URL**: TAGBASE checks the value when you save. A
  URL must start with `https://` or `http://`.
- **Number**: stored as a number, not as text, optionally between a minimum
  and a maximum.
- **Date**: a date picker.
- **Checkbox**: a yes or no.
- **Select**: one of the options you define on the field, one per line.
- **Country**: a searchable country list, stored as the two-letter country
  code.
- **Entity**: links each tag to one record of an
  [entity](/docs/dashboard/entities), such as the partner that sells the
  product. Add it from the Entities part of the Add Field menu. A category
  can link to several entities, one field per entity, and the field keeps
  the entity's name.

The label sets the field's key, the name its value is stored under. "Best
Before" becomes `best_before`. Keys stay fixed once you save the category, so
renaming a label later does not move existing data.

The preview on the right of the dialog shows the product form as you edit.

## Starters

A new category starts empty and offers three starters: Cosmetics, Spirits,
and Apparel. Pick one, change what you like, and save. The starter itself never changes.

## Using a category

- **Creating a product**: choose the category under Details and fill in the
  fields. The values go to every tag of the product. `{{number}}` and
  `{{total}}` work in a field, so a number field set to `{{number}}` counts
  the tags. The Custom Data field of Advanced Options steps aside while a
  category is chosen.
- **Editing a tag**: the same fields appear on the tag with that tag's values,
  so one tag can carry a different batch than the rest.
- **Placeholders**: field values work in the title and description, for
  example `{{batch}}`.
- **API**: a product response includes the category it belongs to. A
  verification fetched through the API carries the tag's data, which is how a
  page on your own domain shows the field values.

## Tasks

- **Ask the agent**: the way we recommend. Tell the TAGBASE Agent what your
  products are about, for example "We sell hand-made leather bags. Each one
  needs the artisan, the leather type, the production date, and the retailer
  that sold it. Build a category for that." When a detail names an entity
  the team already keeps, the agent links that entity. When it names a
  person, a company, or a place with no matching entity, the agent suggests
  a new entity with a unique field such as an email or a code. If a category
  such as Bags already exists, the agent shows buttons, for example Update
  Bags and Create Simple Bags. It opens the category for you to fine-tune.
- **[Create a category](/dashboard/categories/new)**: name it and add fields
  by hand. Save it with no fields when you only want to group products.
- **[Manage categories](/dashboard/categories)**: edit or delete a category.
  Deleting one keeps the data already written to tags.

Next: where the values go and how to number items, under
[custom data](/docs/dashboard/custom-data).

