Skip to main content
GET
/
v1
/
logistics
/
recharges
Get Logistics Recharges
const options = {
  method: 'GET',
  headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};

fetch('https://api.dcycle.io/v1/logistics/recharges', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "page": 123,
  "size": 123,
  "total": 123,
  "items": [
    {
      "id": "<string>",
      "vehicle_license_plate": "<string>",
      "vehicle_type": "<string>",
      "fuel_name": "<string>",
      "quantity": 123,
      "unit": "<string>",
      "date": "<string>",
      "co2e": 123,
      "created_at": {},
      "updated_at": {}
    }
  ]
}

Get Logistics Recharges

Retrieve all logistics recharges (fuel consumptions) for your organization with pagination and filtering support.
New API: This endpoint is part of the new API architecture with improved design and maintainability.

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

Query Parameters

page
integer
default:"1"
Page number to retrieveExample: 1
size
integer
default:"10"
Number of items per page (1-100)Example: 50
Search by vehicle license plateExample: 1234-ABC
vehicle_type
array[string]
Filter by vehicle type(s)Example: vehicle_type=van_diesel&vehicle_type=rigid_truck
fuel_id
array[string]
Filter by fuel UUID(s)Example: fuel_id=550e8400-e29b-41d4-a716-446655440000
vehicle_license_plate
array[string]
Filter by vehicle license plate(s)Example: vehicle_license_plate=1234-ABC
file_id
array[string]
Filter by source file UUID(s)Example: file_id=550e8400-e29b-41d4-a716-446655440000
date_from
string
Filter by recharge date >= (YYYY-MM-DD)Example: 2024-01-01
date_until
string
Filter by recharge date <= (YYYY-MM-DD)Example: 2024-12-31
created_at_from
string
Filter by creation date >= (YYYY-MM-DD)Example: 2024-01-01
created_at_to
string
Filter by creation date <= (YYYY-MM-DD)Example: 2024-12-31
status
string
Filter by recharge statusExample: active
project_id
string
Filter by project UUID (only recharges linked to this project)Example: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Response

page
integer
Current page number
size
integer
Number of items per page
total
integer
Total number of logistics recharges matching the filters
items
array
Array of logistics recharge objects

Example

curl -X GET "https://api.dcycle.io/v1/logistics/recharges?page=1&size=10&date_from=2024-01-01&date_until=2024-12-31" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}"

Successful Response

{
  "page": 1,
  "size": 10,
  "total": 156,
  "items": [
    {
      "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
      "vehicle_license_plate": "1234-ABC",
      "vehicle_type": "van_diesel",
      "fuel_name": "Diesel B7",
      "quantity": 45.5,
      "unit": "liters",
      "date": "2024-11-20",
      "co2e": 120.35,
      "created_at": "2024-11-21T08:30:00Z",
      "updated_at": "2024-11-21T08:30:00Z"
    },
    {
      "id": "a12bc34d-56ef-7890-ghij-klmnopqrstuv",
      "vehicle_license_plate": "5678-XYZ",
      "vehicle_type": "rigid_truck_7.5_12_t_gvw_average_diesel",
      "fuel_name": "Diesel B7",
      "quantity": 120.0,
      "unit": "liters",
      "date": "2024-11-19",
      "co2e": 317.52,
      "created_at": "2024-11-20T14:15:00Z",
      "updated_at": "2024-11-20T14:15:00Z"
    }
  ]
}

Common Errors

401 Unauthorized

Cause: Missing or invalid API key
{
  "detail": "Invalid API key",
  "code": "INVALID_API_KEY"
}
Solution: Verify your API key is valid and active. Get a new one from Settings → API.

422 Validation Error

Cause: Invalid filter parameters
{
  "detail": [
    {
      "loc": ["query", "size"],
      "msg": "ensure this value is less than or equal to 100",
      "type": "value_error"
    }
  ]
}
Solution: Ensure page is a positive integer and size is between 1 and 100. Date parameters must use YYYY-MM-DD format.

Get Logistics Requests

Retrieve logistics shipment requests

Delete Recharge

Delete a single recharge record

Batch Delete Recharges

Delete multiple recharges at once

Generate Report

Generate ISO 14083 emissions report