Saltar al contenido principal

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

KeyValue
AuthorizationBearer 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)
}
ParameterTypeDescription
parkingIdnumberUnique identifier of the parking location
fromstringStart date and time in ISO 8601 format (UTC)
untilstringEnd 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

FieldTypeDescription
DiastringDay of the week
FechastringDate of the record in ISO 8601 format
disponibilidadesnumberTotal number of available spaces
reservas_pagadasnumberNumber of paid reservations
usadasnumberNumber of spaces actually used
no_usonumberNumber of unused spaces
porcentaje_no_usonumberPercentage of unused spaces
largas_pagadasnumberNumber of long-term paid reservations
largas_usadasnumberNumber of long-term spaces used
largas_no_usonumberNumber of unused long-term spaces
porcentaje_largas_no_usonumberPercentage of unused long-term spaces
canceladasnumberNumber of user-initiated cancellations
canceladasSystemnumberNumber 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"
}