Overview
Categories help you organize and understand your financial activity. Your Finance App supports hierarchical categories with parent-child relationships, allowing you to create detailed breakdowns while maintaining high-level summaries.Hierarchical Structure
Create parent categories with subcategories for detailed organization
Custom Icons & Colors
Personalize categories with hex colors and icon names for visual clarity
Fixed Expenses
Mark categories as fixed to track recurring monthly obligations
Flexible Types
Categories can be INCOME, EXPENSE, or BOTH for maximum flexibility
Category Types
Each category has a type that determines which transactions can use it:- INCOME: Only for income transactions (e.g., Salary, Freelance, Gifts)
- EXPENSE: Only for expense transactions (e.g., Food, Rent, Transportation)
- BOTH: Can be used for both income and expenses (e.g., Reimbursements)
Default Categories
When you create an account, the system can seed default categories for you:- Vivienda (Housing): Alquiler, Servicios, Mantenimiento
- Alimentos (Food): Supermercado, Restaurantes, Delivery
- Transporte (Transportation): Combustible, Transporte Público, Mantenimiento
- Salud (Health): Medicamentos, Consultas, Gimnasio
- And many more…
- Salario (Salary)
- Freelance
- Inversiones (Investments)
- Otros Ingresos (Other Income)
Default categories are marked as
isFixed: false and can be edited or deleted. Only create the seed once per user.Creating Custom Categories
Create a new category with POST/categories:
Request Parameters
Category name (2-50 characters, must be unique per user)
Category type:
INCOME, EXPENSE, or BOTHHex color code (e.g., #FF5733) for visual identification
Icon name (max 50 characters)
Whether this represents a fixed monthly expense (default: false)
UUID of parent category to create a subcategory
Hierarchical Organization
Create subcategories by setting aparentId:
Hierarchy Rules
Parent Validation
Parent Validation
When creating a subcategory:
- The parent must exist and belong to you
- The parent cannot itself be a subcategory
- This prevents overly complex hierarchies
Deletion Cascade
Deletion Cascade
When deleting a parent category:
- All child categories are also soft-deleted
- Transactions keep their category references
- The operation is atomic (all or nothing)
Listing Categories
Retrieve all categories with optional filtering:Query Parameters
- page (number): Page number (default: 1)
- limit (number): Results per page (default: 20)
- type (enum): Filter by INCOME, EXPENSE, or BOTH
Response Format
Categories are returned as a flat list. Use the
parentId field to build the hierarchy on the client side.Getting a Single Category
Retrieve a category with its relationships:- The category itself
children: Array of subcategoriesparent: Parent category object (if this is a subcategory)
Updating Categories
Update an existing category with PATCH/categories/:id:
Validation Rules
- Name uniqueness: If changing the name, it must not conflict with another category
- Parent changes: If changing
parentId, all parent validation rules apply - No self-reference: A category cannot be its own parent
Fixed Expenses
Mark categories as fixed to identify recurring monthly obligations:- Distinguish between fixed and variable expenses in reports
- Plan your monthly budget more accurately
- Identify opportunities to reduce recurring costs
Category-Transaction Coherence
The system enforces type coherence between categories and transactions:Valid Combinations
Valid Combinations
- INCOME transaction → INCOME or BOTH category ✅
- EXPENSE transaction → EXPENSE or BOTH category ✅
- INCOME transaction → EXPENSE category ❌
- EXPENSE transaction → INCOME category ❌
Soft Delete
Deleting a category soft-deletes it and all its children:Soft-deleted categories:
- Won’t appear in category lists
- Can still be referenced by existing transactions
- Preserve data integrity in your financial history
Best Practices
Start with Defaults
Start with Defaults
Use the
/categories/seed endpoint to get started quickly. You can always customize later.Keep Hierarchies Simple
Keep Hierarchies Simple
Limit to 2 levels (parent + child). Deep hierarchies make reports harder to understand.
Use Consistent Colors
Use Consistent Colors
Group related categories with similar colors (e.g., all food categories in shades of green).
Mark True Fixed Expenses
Mark True Fixed Expenses
Only use
isFixed: true for expenses that recur monthly at the same amount (rent, subscriptions).Avoid Too Many Categories
Avoid Too Many Categories
15-25 categories is usually enough. Too many categories make budgeting complex.
