← CoinBandit

πŸ’° CoinBandit API Documentation

Finance Tracking API β€” Base URL: https://bandit.claw.clawy.io/api/finance

πŸ” Authentication

All endpoints require a scoped API key via Authorization header:

Authorization: Bearer fin_<your_key>

API keys are scoped per user. Manage keys via the CoinBandit settings.

πŸ“‚ Categories

GET /api/finance/categories

List all categories, ordered by type and sort_order.

{
  "id": 3,
  "name": "Supermarkt",
  "type": "expense",    // "expense" | "income"
  "emoji": "πŸ›’",
  "sort_order": 3
}
POST /api/finance/categories

Create a new category.

// Request Body
{
  "name": "Drogerie",
  "type": "expense",
  "emoji": "🧴",
  "sort_order": 4     // optional, default 0
}
DELETE /api/finance/categories/:id

Delete a category by ID.

Standard-Kategorien

IDNameTypeEmoji
1Kreditexpense🏦
2Hausexpense🏠
3SupermarktexpenseπŸ›’
9Drogerieexpense🧴
4SonstigesexpenseπŸ“¦
8UrlaubexpenseπŸ–οΈ
5GehΓ€lterincomeπŸ’Ό
6Geschenkeincome🎁
7SonstigesincomeπŸ“₯
Zuordnungsregeln:
πŸ›’ Rewe, Lidl, Aldi, Edeka β†’ immer Supermarkt
🧴 Budni, DM β†’ immer Drogerie
🏦 Kredit β†’ NUR Kreditrate (monatlich gleich)

πŸ“ Entries

GET /api/finance/entries?month=2026-03

List entries for a month. Returns entries with category info.

// Response
{
  "id": 1371,
  "category_id": 8,
  "amount": "512.00",
  "description": "Flug FRA β†’ Dallas",
  "date": "2026-03-15",
  "recurring": false,
  "tags": ["Polynesien 2026"],
  "category_name": "Urlaub",
  "category_type": "expense",
  "category_emoji": "πŸ–οΈ"
}
POST /api/finance/entries

Create a new entry.

// Request Body
{
  "category_id": 8,           // required β€” category ID
  "amount": 512.00,           // required β€” positive number
  "description": "Flug FRA",  // optional
  "date": "2026-03-15",       // optional, default today
  "recurring": false,          // optional, default false
  "tags": ["Polynesien 2026"] // optional, string array
}
⚠️ BetrÀge immer positiv! Ob Einnahme oder Ausgabe wird über die Kategorie (type: expense/income) bestimmt.
PATCH /api/finance/entries/:id

Update an entry. All fields optional β€” only provided fields are changed.

// Request Body (all optional)
{
  "amount": 520.00,
  "description": "Flug korrigiert",
  "category_id": 3,
  "date": "2026-03-16",
  "tags": ["Reise", "Flug"]
}
DELETE /api/finance/entries/:id

Delete an entry by ID.

🏷️ Tags

Tags are flexible string arrays on entries. Use them to group expenses across categories (e.g. by trip, project, or event).

// Example: Tag a flight and hotel for the same trip
POST /api/finance/entries
{ "amount": 512, "category_id": 8, "description": "Flug", "tags": ["Polynesien 2026"] }

POST /api/finance/entries
{ "amount": 150, "category_id": 8, "description": "Hotel", "tags": ["Polynesien 2026"] }

// Update tags on existing entry
PATCH /api/finance/entries/1371
{ "tags": ["Polynesien 2026", "FlΓΌge"] }

πŸ“Š Analytics

GET /api/finance/analytics?period=month&month=2026-03

Get spending/income breakdown by category.

Parameters:

// Response
{
  "categories": [
    { "type": "expense", "category": "Supermarkt", "emoji": "πŸ›’", "total": "175.34", "count": "4" },
    { "type": "income", "category": "GehΓ€lter", "emoji": "πŸ’Ό", "total": "7340.00", "count": "4" }
  ],
  "topDescriptions": [ ... ]
}
GET /api/finance/summary?month=2026-03

Get monthly totals (total income, total expenses, balance).

🏦 Accounts

GET /api/finance/accounts

List all bank accounts.

POST /api/finance/accounts
{
  "name": "Sparda Hauptkonto",
  "bank": "Sparda-Bank Hamburg",
  "emoji": "🏦",
  "initial_balance": 5000,
  "is_default": true
}
PATCH /api/finance/accounts/:id

Update account. Fields: name, bank, emoji, current_balance, is_default.

DELETE /api/finance/accounts/:id

Delete account. Entries linked to it will have account_id set to NULL.

πŸ”‘ API Keys Management

GET /api/finance/keys

List API keys for the authenticated user. Requires session cookie auth (management endpoint).

POST /api/finance/keys

Generate a new API key. Requires session cookie auth.

{ "name": "My App Key" }
πŸ’‘ Tipp: CoinBandit wird von Sarah und Hendrik genutzt β€” jeder hat eigene API Keys.

🦝 CoinBandit API v2 β€” Last updated: March 2026