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

# Transaction Categorization

> Understand how Flinks categorizes transactions into primary and sub-categories for financial analysis.

Flinks Broad Categorization assigns a **Category** and **SubCategory** to every transaction, providing structured financial insights from raw transaction data.

## How it works

Flinks uses machine learning models to analyze transaction descriptions and classify them into standardized categories. This categorization is available for both Canadian and US transactions.

To retrieve categories programmatically, use the [/Categories](/api/enrich/endpoints/attributes-libraries/categories) endpoint, which returns the full list of categories for a specific country.

## Primary categories

Flinks organizes transactions into the following primary categories:

| Category           | Description                                         |
| :----------------- | :-------------------------------------------------- |
| **Food & Dining**  | Restaurants, groceries, food delivery               |
| **Health**         | Medical, dental, pharmacy, fitness                  |
| **Home**           | Rent, mortgage, maintenance, furnishing             |
| **Income**         | Salary, freelance, government benefits, refunds     |
| **Travel**         | Flights, hotels, car rental, public transit         |
| **Utilities**      | Electricity, gas, water, internet, phone            |
| **Insurance**      | Health, auto, home, life insurance                  |
| **Transfers**      | Bank transfers, wire transfers, internal moves      |
| **Shopping**       | Retail, clothing, electronics, online purchases     |
| **Entertainment**  | Streaming, gaming, events, hobbies                  |
| **Education**      | Tuition, books, courses, student loans              |
| **Transportation** | Gas, parking, auto maintenance, rideshare           |
| **Financial**      | Bank fees, interest, investment contributions       |
| **Personal**       | Personal care, gifts, donations, subscriptions      |
| **Business**       | Office supplies, professional services, advertising |
| **Other**          | Uncategorized or miscellaneous transactions         |

Each primary category contains multiple sub-categories for more granular classification.

## Using the API

### GetCategorization

Use the [/GetCategorization](/api/enrich/endpoints/consumer-attributes/get-categorization) endpoint to retrieve categorized transactions for a connected account:

```bash theme={null}
curl -X POST \
  https://{instance}-api.private.fin.ag/v3/{customerId}/BankingServices/GetCategorization \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {API Secret}' \
  -d '{
    "RequestId": "{requestId}"
  }'
```

### Upload/Categorization

For external transaction data (not collected through Flinks Connect), use the [/Upload/Categorization](/api/upload/endpoints/document-processing/upload-categorization) endpoint:

```bash theme={null}
curl -X POST \
  https://{instance}-api.private.fin.ag/v3/{customerId}/Categorization/Upload \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {API Secret}' \
  -d '{
    "OriginCountry": "ca",
    "Transactions": [
      {
        "TransactionDate": "2025-01-15",
        "Description": "UBER EATS",
        "Debit": "25.50",
        "Credit": null,
        "Balance": "1500.00"
      }
    ]
  }'
```

### Example response

```json theme={null}
{
  "HttpStatusCode": 200,
  "Transactions": [
    {
      "Description": "UBER EATS",
      "Category": "Food & Dining",
      "SubCategory": "Food Delivery",
      "Debit": 25.50,
      "Credit": null,
      "Date": "2025-01-15"
    }
  ]
}
```

## Country-specific models

Flinks maintains separate categorization models for Canada and the US. The `/Categories` endpoint accepts a `CountryCode` parameter (`CA` or `US`) to return the appropriate category list.

<Note>
  The `/Upload/Categorization` endpoint currently supports US market transactions only. For Canadian transactions collected through Flinks Connect, use the standard `/GetCategorization` endpoint.
</Note>
