curl -X POST https://api.yourfinanceapp.com/api/budgets \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"amount": 50000.0,
"month": 1,
"year": 2026,
"categoryId": "660e8400-e29b-41d4-a716-446655440001"
}'
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"amount": 50000.0,
"month": 1,
"year": 2026,
"categoryId": "660e8400-e29b-41d4-a716-446655440001",
"userId": "770e8400-e29b-41d4-a716-446655440002"
}
Create a new monthly budget for a category
curl -X POST https://api.yourfinanceapp.com/api/budgets \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"amount": 50000.0,
"month": 1,
"year": 2026,
"categoryId": "660e8400-e29b-41d4-a716-446655440001"
}'
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"amount": 50000.0,
"month": 1,
"year": 2026,
"categoryId": "660e8400-e29b-41d4-a716-446655440001",
"userId": "770e8400-e29b-41d4-a716-446655440002"
}
400 Bad Request - “El presupuesto supera el límite de la categoría padre. Disponible: $X.”
400 Bad Request - “El monto es menor a la suma de las subcategorías ($X). Ajusta las subcategorías primero.”
409 Conflict - “Ya existe un presupuesto para esta categoría este mes.”
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"amount": 50000.0,
"month": 1,
"year": 2026,
"categoryId": "660e8400-e29b-41d4-a716-446655440001",
"userId": "770e8400-e29b-41d4-a716-446655440002"
}
curl -X POST https://api.yourfinanceapp.com/api/budgets \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"amount": 50000.0,
"month": 1,
"year": 2026,
"categoryId": "660e8400-e29b-41d4-a716-446655440001"
}'