# Categories

Categories can be used to mark [listings](https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/listing) as belonging to a specific group. A listing can belong to one to many categories. The `categoryRef` on the listing allows assigning categories to a listing. Categories can be used, for example, to define discounts for certain article groups.

Listings can be assigned to an article category by:

1. Creating a category via [API](https://fulfillmenttools.github.io/fulfillmenttools-api-reference-ui/#get-/api/categories)
2. Referencing the ID of the category in the respective listing(s)

Categories can be created, edited and deleted via [REST API](https://fulfillmenttools.github.io/fulfillmenttools-api-reference-ui/#get-/api/categories). Categories that are assigned to one or more listings cannot be deleted.

{% hint style="info" %}
For a complete overview of the category endpoints, refer to the [API documentation for Categories](https://fulfillmenttools.github.io/fulfillmenttools-api-reference-ui/#get-/api/categories).
{% endhint %}

## Create a category

To create a category, send a `POST` request to the following endpoint with the category data in the request body.

```http
POST https://{YOUR-TENANT-NAME}.api.fulfillmenttools.com/api/categories
```

**Example request body**

```json
{
  "nameLocalized": {
    "de_DE": "Lebensmittel",
    "en_US": "groceries"
  },
  "tenantCategoryId": "G-01"
}
```

A successful request returns a `201 CREATED` response with a body that includes the `id` of the newly created category.

**Example response body**

```json
{
    "lastModified": "2025-04-25T09:06:54.737Z",
    "version": 1,
    "nameLocalized": {
        "de_DE": "Lebensmittel",
        "en_US": "groceries"
    },
    "tenantCategoryId": "G-01",
    "id": "1f6fe169-893f-4e95-8ac0-38c9e6eca068",
    "created": "2025-04-25T09:06:54.737Z",
    "name": "groceries"
}
```
