Consumption Report
This endpoint provides detailed consumption statistics for a specific parking location within a given time period.
Description
The Consumption report gives you insights into parking space utilization, including metrics like paid reservations, used spaces, cancellations, and system cancellations. This data is useful for analyzing parking usage patterns and optimizing space allocation.
Endpoint
POST /api/v3/business/report/consume
Authentication
This endpoint requires authentication using a Bearer token.
Headers
| Key | Value |
|---|---|
| Authorization | Bearer Token |
Request Parameters
Body
{
"parkingId": 95, // ID of the parking location
"from": "2025-05-01T04:00:00.000Z", // Start date and time (UTC)
"until": "2025-05-31T03:59:59.999Z" // End date and time (UTC)
}
| Parameter | Type | Description |
|---|---|---|
| parkingId | number | Unique identifier of the parking location |
| from | string | Start date and time in ISO 8601 format (UTC) |
| until | string | End date and time in ISO 8601 format (UTC) |
Response
The response is an array of daily consumption records.
Success Response (200 OK)
[
{
"Dia": "Friday", // Day of the week
"Fecha": "2025-05-30T04:00:00.000Z", // Date of the record
"disponibilidades": 47, // Total available spaces
"reservas_pagadas": 1, // Number of paid reservations
"usadas": 1, // Number of spaces used
"no_uso": 0, // Number of unused spaces
"porcentaje_no_uso": 0, // Percentage of unused spaces
"largas_pagadas": 0, // Number of long-term paid reservations
"largas_usadas": 0, // Number of long-term spaces used
"largas_no_uso": 0, // Number of unused long-term spaces
"porcentaje_largas_no_uso": null, // Percentage of unused long-term spaces
"canceladas": 1, // Number of user cancellations
"canceladasSystem": 18 // Number of system cancellations
}
]
Response Fields
| Field | Type | Description |
|---|---|---|
| Dia | string | Day of the week |
| Fecha | string | Date of the record in ISO 8601 format |
| disponibilidades | number | Total number of available spaces |
| reservas_pagadas | number | Number of paid reservations |
| usadas | number | Number of spaces actually used |
| no_uso | number | Number of unused spaces |
| porcentaje_no_uso | number | Percentage of unused spaces |
| largas_pagadas | number | Number of long-term paid reservations |
| largas_usadas | number | Number of long-term spaces used |
| largas_no_uso | number | Number of unused long-term spaces |
| porcentaje_largas_no_uso | number | Percentage of unused long-term spaces |
| canceladas | number | Number of user-initiated cancellations |
| canceladasSystem | number | Number of system-initiated cancellations |
Example Usage
cURL
curl -X POST \
'https://api.example.com/api/v3/business/report/consume' \
-H 'Authorization: Bearer your_token_here' \
-H 'Content-Type: application/json' \
-d '{
"parkingId": 95,
"from": "2025-05-01T04:00:00.000Z",
"until": "2025-05-31T03:59:59.999Z"
}'
JavaScript
const response = await fetch('https://api.example.com/api/v3/business/report/consume', {
method: 'POST',
headers: {
'Authorization': 'Bearer your_token_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
parkingId: 95,
from: '2025-05-01T04:00:00.000Z',
until: '2025-05-31T03:59:59.999Z'
})
});
const data = await response.json();
Error Responses
400 Bad Request
{
"error": "Invalid date range"
}
401 Unauthorized
{
"error": "Invalid or missing authentication token"
}
404 Not Found
{
"error": "Parking location not found"
}