Overview
Budget items represent individual line items within a budget. Each item has:- Type and Concept: Classification of the expense (e.g., Maintenance → Oil Change)
- Frequency: How many times per month the expense occurs
- Applicable Months: Array of months (1-12) when this expense applies
- Unit Price: Cost per occurrence
- Total Value: Automatically calculated as
valor_unitario × frecuencia_mes × meses_aplicables.length
Add Item to Budget
Add a new line item to an existing budget.Endpoint
Authentication
Requires valid JWT Bearer token.Path Parameters
Budget ID to add the item to
Request Body
Budget type ID (e.g., 3 for “Mantenimiento Preventivo”)
Concept ID within the type (e.g., 15 for “Cambio de Aceite”)
How many times per month this expense occurs. Example: 1 for monthly, 2 for twice per month.
Array of month numbers (1-12) where this item applies.Examples:
- All year:
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] - Quarterly:
[3, 6, 9, 12] - First semester:
[1, 2, 3, 4, 5, 6]
Unit price for this expense in Colombian pesos (COP).The total value is automatically calculated as:
valor_unitario × frecuencia_mes × meses_aplicables.lengthResponse
Created item ID
Parent budget ID
Budget type ID
Concept ID
Frequency per month
Array of applicable months
Unit price
Total value (calculated)
Example Request
Calculation Example
Example Response
Update Budget Item
Update an existing budget item. The total value is automatically recalculated when updating any of the component values.Endpoint
Authentication
Requires valid JWT Bearer token.Path Parameters
Budget item ID to update
Request Body
All fields are optional. Only include fields you want to update.Budget type ID
Concept ID
Frequency per month
Array of applicable months (1-12)
Unit price
Response
Returns the updated item with recalculated valor_total.Item ID
Parent budget ID
Budget type ID
Concept ID
Frequency per month
Array of applicable months
Unit price
Total value (recalculated)
Example Request
Calculation Example
Example Response
The system automatically fetches current values for fields not included in the update to ensure accurate total calculation.
Delete Budget Item
Delete a budget item from a budget.Endpoint
Authentication
Requires valid JWT Bearer token.Path Parameters
Budget item ID to delete
Response
Returns HTTP 204 No Content on success.Example Request
Common Use Cases
Monthly Preventive Maintenance
- Occurs once every month
- Applied all 12 months
- Total: 250,000 × 1 × 12 = 3,000,000 COP
Quarterly Tire Inspection
- Occurs once per month
- Applied in 4 months (quarterly)
- Total: 180,000 × 1 × 4 = 720,000 COP
Weekly Washing (First Semester)
- Occurs 4 times per month (weekly)
- Applied in 6 months (first semester)
- Total: 35,000 × 4 × 6 = 840,000 COP
Biweekly Fuel Budget
- Occurs twice per month (biweekly)
- Applied all 12 months
- Total: 450,000 × 2 × 12 = 10,800,000 COP
Budget Item Workflow
- Create Budget: First create the budget header with
POST /api/presupuestos - Add Items: Add line items one by one with
POST /api/presupuestos/:id/items - Review: Get full budget with items using
GET /api/presupuestos/:id - Adjust: Update items as needed with
PUT /api/presupuestos/items/:itemId - Approve: Change budget estado to “APROBADO” with
PUT /api/presupuestos/:id