Negocio recurrente
Recurrentes dados de baja
POST
https://api.afer.pro/consultarRecurrentesBajas
El churn del negocio recurrente: servicios con fecha de caducidad dentro del rango, agrupados por periodicidad.
La tercera pata del negocio recurrente, junto a las altas y las renovaciones: los servicios cuya fecha de caducidad cae en el rango — el MRR/ARR que se pierde.
Misma estructura que las altas: agrupado por periodicidad con número de bajas, importe por ciclo perdido y el detalle de cada servicio con su cliente.
Autenticación
Envía tus claves API en las cabeceras X-API-KEY y X-API-SECRET. La cuenta sobre la que se opera se resuelve automáticamente a partir de la clave. Cómo obtener tus claves →
Este endpoint requiere autenticación con API key: sin credenciales responde 401.
Parámetros del cuerpo
El cuerpo de la petición es un objeto JSON con Content-Type: application/json.
fecha_iniciodateobligatorio | Inicio del período de bajas (YYYY-MM-DD), incluido. |
fecha_findateobligatorio | Fin del período (YYYY-MM-DD), incluido. |
Ejemplo de petición
curl -X POST 'https://api.afer.pro/consultarRecurrentesBajas' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: afer_tk_TU_TOKEN' \
-H 'X-API-SECRET: afer_sk_TU_SECRET' \
-d '{
"fecha_inicio": "2026-01-01",
"fecha_fin": "2026-06-30"
}'
<?php
$data = [
'fecha_inicio' => '2026-01-01',
'fecha_fin' => '2026-06-30',
];
$ch = curl_init('https://api.afer.pro/consultarRecurrentesBajas');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'X-API-KEY: afer_tk_TU_TOKEN',
'X-API-SECRET: afer_sk_TU_SECRET',
]);
$respuesta = json_decode(curl_exec($ch), true);
curl_close($ch);
const respuesta = await fetch('https://api.afer.pro/consultarRecurrentesBajas', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': 'afer_tk_TU_TOKEN',
'X-API-SECRET': 'afer_sk_TU_SECRET'
},
body: JSON.stringify({
"fecha_inicio": "2026-01-01",
"fecha_fin": "2026-06-30"
})
});
const resultado = await respuesta.json();
Respuesta
200 · application/json
{
"errorCode": 200,
"errorMsg": "",
"data": {
"fecha_inicio": "2026-01-01",
"fecha_fin": "2026-06-30",
"num_bajas": 3,
"importe_total": 1550,
"por_periodicidad": {
"mensual": {
"periodicidad_dias": 30,
"num": 2,
"importe_total": 350,
"recurrentes": [
{
"recurrenteId": "aBc123XyZ…",
"descripcion": "Cuota mantenimiento web",
"importe": 150,
"fecha_alta": "2024-03-01",
"fecha_baja": "2026-04-30",
"cliente": {
"clienteId": "dEf456…",
"nombre_fiscal": "FERRER INTERIORS SL"
}
}
]
}
}
}
}
Notas
- La baja se cuenta en la fecha de caducidad del servicio, aunque se configurase con antelación.