FineFlow Backend API
Personal finance tracking with AI-powered insights and multi-currency support
GET /api/transactions - List transactions with filters
POST /api/transactions - Create new transaction
GET /api/transactions/[id] - Get single transaction
PATCH /api/transactions/[id] - Update transaction
DELETE /api/transactions/[id] - Delete transaction
GET /api/wallets - List all wallets
POST /api/wallets - Create new wallet
GET /api/wallets/[id] - Get wallet with stats
PATCH /api/wallets/[id] - Update wallet
DELETE /api/wallets/[id] - Delete wallet
GET /api/categories - List all categories
POST /api/categories - Create custom category
Filter by type: ?type=ingreso|gasto
GET /api/analytics - Get financial analytics
Periods: ?period=7d|30d|90d|1y
Returns: summary, charts data, top categories
POST /api/ai/chat - Chat with AI assistant
Tools: transaction summary, spending analysis, trends
GET /api/ai/insights - Auto-generated insights
POST /api/currency/convert - Convert amounts
GET /api/currency/rates - Get exchange rates
Includes P2P and BCV official rates for Venezuela
GET /api/assets - List assets with P/L
POST /api/assets - Add new asset
POST /api/assets/[id]/transactions - Record buy/sell
GET /api/portfolio/summary - Portfolio overview
GET /api/debts - List all debts
POST /api/debts - Create lend/borrow record
POST /api/debts/[id]/payments - Record payment
GET /api/debts/summary - Net position
GET /api/budgets - List budgets with status
POST /api/budgets - Create budget
PATCH /api/budgets/[id] - Update budget
Periods: weekly, monthly, quarterly, yearly
GET /api/dashboard/summary
Returns: balances, budgets, debts, rates
Includes VES P2P vs BCV gap percentage
GET /api/reports/monthly
Query: ?year=2026&month=2
Returns: by category, by wallet, daily breakdown
GET /api/recurring - List recurring
POST /api/recurring - Create recurring
DELETE /api/recurring/[id]?stop_only=true
Patterns: daily, weekly, monthly, yearly
GET /api/enums - All enum values
GET /api/enums?name=wallet_type
Types: wallet_type, transaction_type, payment_method