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

# Expense & Income Tracking with SAFIA

> Record expenses, income, and debts through natural Telegram chat. Filter your history, get financial summaries, and manage your money effortlessly.

SAFIA turns your everyday Telegram messages into a complete financial ledger. Just describe what you spent or earned — SAFIA understands natural language in both Bahasa Indonesia and English, auto-detects categories, and keeps a running record of every transaction without any forms or spreadsheets.

<Note>
  SAFIA allows up to **1000 messages per user per day**. Plan your interactions accordingly — bulk actions like reviewing a summary or deleting multiple records count as a single message each.
</Note>

## Recording Expenses and Income

Tell SAFIA what you spent or earned in plain language. No special commands are needed — just chat naturally. SAFIA automatically detects whether it's an expense or income and assigns the most relevant category.

```text Example — recording an expense theme={null}
You:    I spent 50000 on lunch

SAFIA:  Noted! 🍽️ Rp 50.000 for Food has been recorded.
        Food is now your top category this week at Rp 185.000.
```

```text Example — recording income theme={null}
You:    Gajian hari ini 8 juta

SAFIA:  Selamat! ✨ Pendapatan Rp 8.000.000 (Gaji) sudah dicatat.
        Saldo kamu sekarang Rp 6.320.000 setelah pengeluaran bulan ini.
```

```text Example — recording multiple items at once theme={null}
You:    Beli bensin 80rb, bayar parkir 5rb, jajan 25rb

SAFIA:  Semua sudah tercatat:
        • Transportasi — Rp 80.000 (bensin)
        • Transportasi — Rp 5.000 (parkir)
        • Makanan — Rp 25.000 (jajan)
        Total pengeluaran hari ini: Rp 110.000.
```

**Default expense categories** SAFIA recognises include Makanan (Food), Transportasi (Transport), Cicilan (Installments), Zakat/Infaq (Charity), Hiburan (Entertainment), and Tabungan (Savings). SAFIA will also create new categories on the fly when your description clearly doesn't fit an existing one.

<Tip>
  You can also photograph a receipt or payslip and send the image to SAFIA. It will extract the total amount and record the transaction automatically.
</Tip>

***

## Debt Management

SAFIA tracks money you lend to others or borrow from others, separately from your regular expenses and income. You can mark debts as settled once they're repaid.

<Steps>
  <Step title="Record money you lent">
    Tell SAFIA you lent money and to whom.

    ```text theme={null}
    You:    Pinjamin Budi 200rb

    SAFIA:  Tercatat 💸 Piutang Rp 200.000 ke Budi.
            Total piutang kamu sekarang Rp 200.000 (belum lunas).
    ```
  </Step>

  <Step title="Record money you borrowed">
    ```text theme={null}
    You:    Pinjem uang ke Sari 500 ribu buat bensin

    SAFIA:  Oke, hutang Rp 500.000 dari Sari sudah dicatat.
            Ingat untuk segera dilunasi ya 😊
    ```
  </Step>

  <Step title="Mark a debt as settled">
    ```text theme={null}
    You:    Budi sudah bayar balik

    SAFIA:  Piutang ke Budi Rp 200.000 sudah ditandai lunas ✅
            Tidak ada piutang aktif saat ini.
    ```
  </Step>
</Steps>

Outstanding debts (both lent and borrowed) are factored into your **total balance** shown in the financial summary.

***

## Reviewing Your Records

Ask SAFIA to show your records at any time. You can filter by date range, category, or transaction type.

<Tabs>
  <Tab title="All records">
    ```text theme={null}
    You:    Tampilkan semua pengeluaran bulan ini

    SAFIA:  Pengeluaran Juni (14 transaksi):
            • Makanan — Rp 620.000
            • Transportasi — Rp 215.000
            • Hiburan — Rp 150.000
            • Cicilan — Rp 500.000
            Total: Rp 1.485.000
    ```
  </Tab>

  <Tab title="Filter by category">
    ```text theme={null}
    You:    Show me all food expenses this month

    SAFIA:  Your Food expenses in June (8 transactions):
            • 2 Jun — Rp 50.000 (lunch)
            • 4 Jun — Rp 75.000 (dinner with family)
            • 7 Jun — Rp 30.000 (breakfast)
            ... and 5 more.
            Total: Rp 620.000
    ```
  </Tab>

  <Tab title="Filter by date range">
    ```text theme={null}
    You:    Pengeluaran dari 1 sampai 7 Juni

    SAFIA:  Pengeluaran 1–7 Juni (5 transaksi), total Rp 285.000.
            Kategori terbesar: Makanan (Rp 155.000).
    ```
  </Tab>

  <Tab title="Filter by amount">
    ```text theme={null}
    You:    Transaksi di atas 200 ribu bulan ini

    SAFIA:  Ada 3 transaksi di atas Rp 200.000 bulan ini:
            • Cicilan motor — Rp 500.000
            • Belanja bulanan — Rp 380.000
            • Bensin — Rp 210.000
    ```
  </Tab>
</Tabs>

***

## Financial Summary

Ask SAFIA for a summary to get a full picture of your balance, top spending categories, and debt status — all in one reply.

```text theme={null}
You:    Gimana kondisi keuanganku bulan ini?

SAFIA:  Ringkasan Juni:
        💰 Pemasukan: Rp 8.000.000
        💸 Pengeluaran: Rp 1.485.000
        🏦 Saldo bersih: Rp 6.515.000

        Kategori terbesar: Makanan (Rp 620.000 · 42% dari pengeluaran)
        Hutang aktif: Rp 500.000 ke Sari
        Piutang aktif: —

        Keuangan bulan ini cukup sehat ✨ Pengeluaran makanmu
        agak tinggi — mau aku ingatkan setiap makan siang?
```

The summary includes:

<CardGroup cols={2}>
  <Card title="Balance" icon="scale-balanced">
    Total income minus total expenses, adjusted for outstanding lent and borrowed amounts.
  </Card>

  <Card title="Top Categories" icon="chart-pie">
    Spending broken down by category with amounts and percentage share.
  </Card>

  <Card title="Debt Overview" icon="handshake">
    Outstanding amounts you lent (piutang) and borrowed (hutang), separately tracked.
  </Card>

  <Card title="Record Count" icon="list">
    Total number of expense and income entries in the selected period.
  </Card>
</CardGroup>

You can request a summary for any time period: "summary for last week", "summary for Q1", or "summary from March to May".

***

## Deleting Records

<Accordion title="Delete a specific record">
  Ask SAFIA to remove a particular transaction by describing it.

  ```text theme={null}
  You:    Hapus catatan bensin tadi

  SAFIA:  Pengeluaran Rp 80.000 (bensin) sudah dihapus ✅
  ```
</Accordion>

<Accordion title="Delete records by filter">
  You can delete multiple records at once using date or category filters.

  ```text theme={null}
  You:    Hapus semua catatan Hiburan bulan Juni

  SAFIA:  3 catatan Hiburan di bulan Juni sudah dihapus.
  ```
</Accordion>

<Accordion title="Reset all records">
  To wipe your entire transaction history, ask SAFIA to reset all records.

  ```text theme={null}
  You:    Reset semua catatan keuanganku

  SAFIA:  Yakin? Ini akan menghapus semua catatan secara permanen.
          Ketik "ya, hapus semua" untuk konfirmasi.

  You:    ya, hapus semua

  SAFIA:  Semua catatan (47 transaksi) sudah dihapus 🗑️
          Mulai lembaran baru!
  ```

  <Warning>
    Resetting all records is permanent and cannot be undone. SAFIA will ask for your confirmation before proceeding.
  </Warning>
</Accordion>
