# Categories and AI rules (https://docs.getbeel.com/en/guide/invoice-management/categories-rules)

Organize expenses with categories and give the AI plain-language instructions for reading invoices.

**Categories** group received invoices by type of expense. **AI rules** are plain-language instructions the AI follows when it reads a new invoice.

## Default categories [#default-categories]

Every team starts with 10 categories, marked **Default**:

| Category                  | For example                    |
| ------------------------- | ------------------------------ |
| **Software & SaaS**       | Subscriptions, licenses, APIs  |
| **Cloud Infrastructure**  | Hosting and cloud services     |
| **Utilities**             | Internet, phone, energy        |
| **Travel**                | Flights, hotels, transport     |
| **Food & Dining**         | Business lunches and dinners   |
| **Hardware**              | Computers, monitors, equipment |
| **Professional Services** | Legal and accounting advice    |
| **Marketing**             | Advertising, tools, agencies   |
| **Office Supplies**       | Stationery and office supplies |
| **Other**                 | Everything else                |

You cannot delete the default categories.

## Create a category [#create-a-category]

<Steps>
<Step>

### Open the categories [#open-the-categories]

Open **Settings → Categories** and press **Add category**.

</Step>
<Step>

### Give it a name and a color [#give-it-a-name-and-a-color]

Enter the **Label**, for example "Legal fees", and choose a **Color**. Press **Create**.

</Step>
</Steps>

You can also create a category from the list: in an invoice's **Category** column, type a new name and choose **Create "…"**.

When you delete one of your own categories, its invoices move to **Other**. You cannot undo this.

## Add an AI rule [#add-an-ai-rule]

<Steps>
<Step>

### Open the rules [#open-the-rules]

Open **Settings → AI Rules** and press **Add rule**.

</Step>
<Step>

### Write the rule [#write-the-rule]

Write it as you would tell a colleague, in at most 500 characters. For example:

- _"Exclude invoices from billing@shopify.com"_
- _"For Cloudflare invoices, set the due date to net 30 days"_
- _"Google Workspace invoices go in Software & SaaS"_

</Step>
<Step>

### Save it and turn it on [#save-it-and-turn-it-on]

Leave **Active** on and save.

</Step>
</Steps>

## What just happened [#what-just-happened]

- **The category is available** in the filters, in the list and to the AI.
- **The rule applies to new invoices.** The AI follows it when it reads the next invoices, not the ones it already read.
- **Rules apply in order**, from first to last. The AI follows only the active ones.

To test the effect of a rule, turn it off with the switch instead of deleting it.

## If it fails [#if-it-fails]

| Message                                        | Cause                            | Fix                                                     |
| ---------------------------------------------- | -------------------------------- | ------------------------------------------------------- |
| "Label is required"                            | The name is empty                | Enter a label                                           |
| "Label must be at most 100 characters"         | The name is too long             | Shorten it                                              |
| "Rule text is required"                        | The rule is empty                | Write the rule                                          |
| An invoice already read has the wrong category | Rules only apply to new invoices | Change the category from the list's **Category** column |

## Next steps [#next-steps]

<Cards>
  <Card
    title="Invoice workflow"
    href="/en/guide/invoice-management/invoice-workflow"
  >
    Check and export the classified invoices.
  </Card>
  <Card title="Analytics" href="/en/guide/analytics">
    Spending by category over time.
  </Card>
</Cards>
