curl --request GET \
--url https://api.example.com/api/gastos-recurrentes \
--header 'Content-Type: application/json' \
--data '
{
"nombre": "<string>",
"dia_cobro": 123,
"monto": 123,
"activo": true,
"id": "<string>"
}
'{
"data": [
{
"id": "<string>",
"nombre": "<string>",
"dia_cobro": 123,
"monto": 123,
"activo": true,
"categoria": "<string>",
"metodo_pago": "<string>",
"cuenta": "<string>",
"ultima_ejecucion": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
]
}Manage monthly recurring expenses and subscriptions with full CRUD operations
curl --request GET \
--url https://api.example.com/api/gastos-recurrentes \
--header 'Content-Type: application/json' \
--data '
{
"nombre": "<string>",
"dia_cobro": 123,
"monto": 123,
"activo": true,
"id": "<string>"
}
'{
"data": [
{
"id": "<string>",
"nombre": "<string>",
"dia_cobro": 123,
"monto": 123,
"activo": true,
"categoria": "<string>",
"metodo_pago": "<string>",
"cuenta": "<string>",
"ultima_ejecucion": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
]
}gastos_mensuales table and maps fields to a frontend-friendly format.
GET /api/gastos-recurrentes
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"nombre": "Netflix",
"dia_cobro": 5,
"monto": 219.00,
"activo": true,
"categoria": "Suscripciones",
"metodo_pago": "Tarjeta",
"cuenta": null,
"ultima_ejecucion": null,
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-15T10:00:00Z"
},
{
"id": "550e8400-e29b-41d4-a716-446655440001",
"nombre": "Spotify",
"dia_cobro": 12,
"monto": 119.00,
"activo": true,
"categoria": "Suscripciones",
"metodo_pago": "Tarjeta",
"cuenta": null,
"ultima_ejecucion": null,
"created_at": "2024-01-20T14:30:00Z",
"updated_at": "2024-01-20T14:30:00Z"
}
]
}
POST /api/gastos-recurrentes
"Amazon Prime"1599.00{
"nombre": "Disney+",
"dia_cobro": 10,
"monto": 159.00,
"activo": true
}
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440002",
"nombre": "Disney+",
"dia_cobro": 10,
"monto": 159.00,
"activo": true,
"categoria": "Suscripciones",
"metodo_pago": "Tarjeta",
"cuenta": null,
"ultima_ejecucion": null,
"created_at": "2024-03-06T15:45:00Z",
"updated_at": "2024-03-06T15:45:00Z"
}
]
}
PUT /api/gastos-recurrentes
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"nombre": "Netflix Premium",
"dia_cobro": 5,
"monto": 299.00,
"activo": true
}
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"nombre": "Netflix Premium",
"dia_cobro": 5,
"monto": 299.00,
"activo": true,
"categoria": "Suscripciones",
"metodo_pago": "Tarjeta",
"cuenta": null,
"ultima_ejecucion": null,
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-03-06T16:00:00Z"
}
]
}
DELETE /api/gastos-recurrentes?id={id}
{
"success": true
}
const response = await fetch('/api/gastos-recurrentes');
const { data } = await response.json();
console.log(`Found ${data.length} recurring expenses`);
data.forEach(expense => {
console.log(`${expense.nombre}: $${expense.monto} on day ${expense.dia_cobro}`);
});
| Database Field | API Field | Type | Notes |
|---|---|---|---|
nombre_app | nombre | string | Subscription/expense name |
dia_de_cobro | dia_cobro | number | Billing day (1-31) |
monto | monto | number | Monthly amount |
activo | activo | boolean | Active status |
categoria field defaults to “Suscripciones” and metodo_pago defaults to “Tarjeta” for all recurring expenses. These values are mapped from the database schema.dia_cobro to set up payment reminders