Consumption

General Description

The Consumption method returns information about fuel consumption, distance, operating hours, as well as the average consumption per 100 km for a vehicle during the requested period. The method can be called for a list of up to 10 vehicles and a period of up to 31 days. If the vehicle is equipped with LPG, data will be returned for both sources.

It is subject to the Rate Limit restrictions.

⚠️ All requests to this endpoint must include the api-version=2.0 parameter in the URL.
URL: POST https://api.trackgps.ro/api/carriers/consumption?api-version=2.0

⚠️ Note: All date and time values sent or returned by this endpoint are in the company’s local time zone.


JSON Request Structure

{
  "vehiclesList": [
    0
  ],
  "startDate": "2024-09-09T07:15:14.124",
  "endDate": "2024-09-09T07:15:14.124"
}
Request Properties
  • vehiclesList: List of vehicles for which the method is called (array of vehicleId).
  • startDate: Start date of the period for which the method is called.
  • endDate: End date of the period for which the method is called.

JSON Response Structure

{
  "payload": [
    {
      "vehicleName": "string",
      "licensePlate": "string",
      "distance": 0,
      "hours": "string",
      "consumptionValue": 0,
      "averageConsumption100Km": 0,
      "secondarySource": {
        "distance": 0,
        "hours": "string",
        "consumptionValue": 0,
        "averageConsumption100Km": 0
      }
    }
  ],
  "correlationId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "failureReasons": [
    {
      "errorCode": "string",
      "errorParameters": [
        "string"
      ]
    }
  ],
  "isSuccess": true
}
Response Properties
Primary Properties
  • vehicleName: Name of the vehicle (string).
  • licensePlate: License plate number (string).
  • distance: Distance traveled in km (numeric).
  • hours: Operating hours in timespan format hours:minutes:seconds (string).
  • consumptionValue: Fuel consumption value in liters (numeric).
  • averageConsumption100Km: Average consumption per 100 km in l/100km (numeric).
Secondary Source Properties
  • secondarySource.distance: Distance traveled by the secondary source in km (numeric).
  • secondarySource.hours: Operating hours of the secondary source in timespan format hours:minutes:seconds (string).
  • secondarySource.consumptionValue: Consumption value for the secondary source in liters (numeric).
  • secondarySource.averageConsumption100Km: Average consumption per 100 km for the secondary source in l/100km (numeric).

Calculating Totals

If the secondary source contains data, to obtain the totals you must sum the data from the primary and secondary sources. For example:

{
  "payload": [
    {
      "vehicleName": "Vehicle A",
      "licensePlate": "AB-12-BCD",
      "distance": 100,
      "hours": "10:00:00",
      "consumptionValue": 50,
      "averageConsumption100Km": 5,
      "secondarySource": {
        "distance": 50,
        "hours": "5:00:00",
        "consumptionValue": 20,
        "averageConsumption100Km": 4
      }
    }
  ],
  "correlationId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "isSuccess": true
}

Totals:

  • distance: 100 + 50 = 150 km
  • hours: 10:00:00 + 5:00:00 = 15:00:00
  • consumptionValue: 50 + 20 = 70 liters
  • averageConsumption100Km: (5 + 4) / 2 = 4.5 l/100km