Skip to main content
GET
/
v1
/
vehicle_consumptions
/
{vehicle_consumption_id}
Get Consumption
const options = {
  method: 'GET',
  headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};

fetch('https://api.dcycle.io/v1/vehicle_consumptions/{vehicle_consumption_id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "id": "<string>",
  "vehicle_id": "<string>",
  "quantity": {},
  "start_date": "<string>",
  "end_date": "<string>",
  "status": "<string>",
  "unit": {},
  "co2e": {},
  "co2e_generation": {},
  "co2e_consumption": {},
  "total_energy_kwh": {},
  "license_plate": {},
  "vehicle": {},
  "user": {},
  "error_messages": {}
}

Get Consumption

Retrieve the full details of a single vehicle consumption record, enriched with CO2e emission calculations.

Request

Headers

x-api-key
string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
x-organization-id
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Path Parameters

vehicle_consumption_id
string
required
UUID of the vehicle consumption record

Response

id
string
Consumption record UUID
vehicle_id
string
UUID of the vehicle this consumption belongs to
quantity
number | null
Fuel quantity consumed
start_date
date
Start date of the consumption period
end_date
date
End date of the consumption period
status
string
Record status: active, loading, error
unit
object
Fuel unit (id, name, type)
co2e
number | null
Total CO2 equivalent emissions in kg
co2e_generation
number | null
Scope 3 (upstream) CO2e from fuel generation
co2e_consumption
number | null
Scope 1 (direct) CO2e from fuel combustion
total_energy_kwh
number | null
Total energy in kWh
license_plate
string | null
Vehicle license plate
vehicle
object | null
Vehicle details (id, name, organization)
user
object | null
User who uploaded the record
error_messages
array[string] | null
Error details when status is error

Example

curl "https://api.dcycle.io/v1/vehicle_consumptions/${CONSUMPTION_ID}" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}"

Successful Response

{
  "id": "consumption-uuid",
  "vehicle_id": "vehicle-uuid",
  "quantity": 450.0,
  "start_date": "2025-01-01",
  "end_date": "2025-03-31",
  "status": "active",
  "unit": { "id": "unit-uuid", "name": "litres", "type": "volume" },
  "co2e": 1170.0,
  "co2e_generation": 117.0,
  "co2e_consumption": 1053.0,
  "total_energy_kwh": 4500.0,
  "license_plate": "1234 ABC",
  "vehicle": {
    "id": "vehicle-uuid",
    "name": "Company Van #12",
    "organization": { "id": "org-uuid", "company_name": "Acme Corp" }
  },
  "user": {
    "id": "user-uuid",
    "first_name": "Ana",
    "last_name": "Garcia"
  },
  "error_messages": null,
  "file_id": null,
  "created_at": "2025-01-15T10:00:00Z",
  "updated_at": "2025-01-15T10:05:00Z"
}

Common Errors

401 Unauthorized

Cause: Missing or invalid API key
{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}

403 Forbidden

Cause: The authenticated user is not a member of the organization
{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}

404 Not Found

Cause: The vehicle consumption record does not exist or belongs to another organization
{"detail": "Not Found"}

Calculation Steps

View detailed emission calculation breakdown

List Consumptions

Browse all consumptions for a vehicle