# Categories (obsolete)

{% hint style="warning" %}
The current version of this feature is obsolete. A major redesign of it is in progress.
{% endhint %}

## API endpoints <a href="#get-a-category" id="get-a-category"></a>

{% hint style="success" %}
Authentication: endpoints listed in this page *require* [header authentication](https://docs.powens.com/api-reference/overview/authentication) with a *user token*.
{% endhint %}

## List categories

<mark style="color:blue;">`GET`</mark> `https://{domain}.biapi.pro/2.0/categories`

Get all categories.

{% tabs %}
{% tab title="200: OK List of categories" %}
Response body: [#categorieslist-object](#categorieslist-object "mention")
{% endtab %}
{% endtabs %}

{% code title="Route aliases:" %}

```
/users/{userId}/categories
/users/{userId}/categories/full
```

{% endcode %}

## Category

<mark style="color:blue;">`GET`</mark> `https://{domain}.biapi.pro/2.0/categories/{categoryId}`

Get a single category by ID.

#### Path Parameters

| Name                                         | Type    | Description  |
| -------------------------------------------- | ------- | ------------ |
| categoryId<mark style="color:red;">\*</mark> | Integer | Category ID. |

{% tabs %}
{% tab title="200: OK Category details" %}
Response body: [#category-object](#category-object "mention")
{% endtab %}
{% endtabs %}

## Data model

### *CategoriesList* object

| Property     | Type                                            | Description                  |
| ------------ | ----------------------------------------------- | ---------------------------- |
| `categories` | Array of [*Category*](#category-object) objects | The full list of categories. |

### *Category* object

| Property             | Type            | Description                                                                              |
| -------------------- | --------------- | ---------------------------------------------------------------------------------------- |
| `id`                 | Integer         | ID of the category.                                                                      |
| `id_parent_category` | Integer         | ID of the parent category. If this is a parent category, it will be equal to its own ID. |
| `name`               | String          | Name of the category.                                                                    |
| `color`              | String          | Color of the category.                                                                   |
| `income`             | Boolean or null | Is an income category. If null, this is both an income and an expense category.          |
| `refundable`         | Boolean         | This category accepts opposite sign of transactions.                                     |
| `id_logo`            | Integer or null | ID of the logo.                                                                          |
