Skip to content

Fleet Management

Overview

Fleet management solutions require comprehensive tools for vehicle tracking, maintenance scheduling, driver management, and route optimization. The De. platform provides the infrastructure and APIs needed to build robust fleet management applications across various industries, from delivery services to commercial trucking.

Key Capabilities

Vehicle Management

Track, monitor, and manage vehicles in your fleet:

typescript
// Register a new vehicle
const vehicle = await de.lsp.fleet.vehicles.create({
  type: 'delivery_van',
  make: 'Ford',
  model: 'Transit',
  year: 2023,
  licensePlate: 'XYZ789',
  vin: '1FTBR1C8XMKA12345',
  color: 'White',
  capacity: {
    volume: { value: 12, unit: 'cubic_meter' },
    weight: { value: 1200, unit: 'kg' },
    dimensions: {
      length: { value: 3.5, unit: 'meter' },
      width: { value: 1.7, unit: 'meter' },
      height: { value: 2.0, unit: 'meter' }
    }
  }
})

// Assign device to vehicle
await de.lsp.fleet.vehicles.assignDevice({
  vehicleId: vehicle.id,
  deviceId: 'dev_456',
  deviceType: 'gps_tracker'
})

// Get vehicle details with latest telemetry
const vehicleDetails = await de.lsp.fleet.vehicles.get({
  vehicleId: vehicle.id,
  includeTelemetry: true,
  includeAssignments: true,
  includeMaintenanceStatus: true
})

Real-Time Tracking

Monitor your entire fleet in real-time:

typescript
// Get current location of all active vehicles
const fleetLocation = await de.lsp.fleet.tracking.getFleetLocation({
  status: 'active',
  includeMetrics: true
})

// Subscribe to real-time location updates via WebSocket
de.realtime.subscribe('fleet.location', (updates) => {
  updates.forEach(vehicle => {
    console.log(`Vehicle ${vehicle.id} at ${vehicle.location.latitude}, ${vehicle.location.longitude}`)
    console.log(`Speed: ${vehicle.metrics.speed} km/h, Heading: ${vehicle.metrics.heading}°`)
    console.log(`Fuel level: ${vehicle.metrics.fuelLevel}%, Battery: ${vehicle.metrics.batteryLevel}%`)
  })
})

// Create geofence and get alerts when vehicles enter/exit
const geofence = await de.lsp.fleet.geofences.create({
  name: 'Warehouse Zone',
  type: 'polygon',
  coordinates: [
    { latitude: 37.123, longitude: -122.456 },
    { latitude: 37.125, longitude: -122.456 },
    { latitude: 37.125, longitude: -122.458 },
    { latitude: 37.123, longitude: -122.458 }
  ]
})

// Subscribe to geofence events
de.realtime.subscribe(`geofence.${geofence.id}`, (event) => {
  console.log(`Vehicle ${event.vehicleId} ${event.eventType} geofence ${geofence.name}`)
})

Maintenance Management

Schedule, track, and optimize vehicle maintenance:

typescript
// Schedule maintenance
const maintenance = await de.lsp.fleet.maintenance.schedule({
  vehicleId: vehicle.id,
  type: 'routine',
  description: 'Oil change and inspection',
  scheduledDate: '2026-02-15',
  estimatedDuration: { value: 2, unit: 'hour' },
  notifyDriver: true,
  priority: 'medium'
})

// Set up maintenance alerts based on metrics
await de.lsp.fleet.maintenance.createAlert({
  name: 'Engine hours alert',
  condition: {
    metric: 'engine_hours',
    operator: 'greater_than',
    value: 5000
  },
  action: 'create_maintenance_task',
  task: {
    type: 'service',
    description: 'Engine service required',
    priority: 'high'
  },
  vehicles: [vehicle.id]
})

// Get maintenance history
const history = await de.lsp.fleet.maintenance.getHistory({
  vehicleId: vehicle.id,
  startDate: '2025-01-01',
  endDate: '2026-01-31'
})

Driver Management

Assign, track, and manage drivers:

typescript
// Create driver profile
const driver = await de.lsp.agents.create({
  type: 'driver',
  user: {
    firstName: 'John',
    lastName: 'Doe',
    email: '[email protected]',
    phone: '+12025550123'
  },
  license: {
    number: 'DL1234567',
    expiration: '2028-06-30',
    class: 'C'
  }
})

// Assign driver to vehicle
await de.lsp.fleet.vehicles.assignDriver({
  vehicleId: vehicle.id,
  driverId: driver.id,
  startTime: '2026-01-16T08:00:00Z',
  endTime: null // ongoing assignment
})

// Track driver hours
const hours = await de.lsp.agents.getHours({
  agentId: driver.id,
  startDate: '2026-01-01',
  endDate: '2026-01-15'
})

console.log('Total hours:', hours.total)
console.log('Driving time:', hours.driving)
console.log('Rest time:', hours.rest)
console.log('HOS compliance:', hours.compliance)

Route Optimization

Optimize routes for your entire fleet:

typescript
// Optimize routes for multiple vehicles
const routePlan = await de.lsp.routing.optimizeFleet({
  depot: {
    location: {
      latitude: 37.7749,
      longitude: -122.4194
    },
    timeWindows: [{
      start: '2026-01-16T08:00:00Z',
      end: '2026-01-16T18:00:00Z'
    }]
  },
  vehicles: [
    { id: 'veh_123', capacity: 1000 },
    { id: 'veh_456', capacity: 1500 }
  ],
  stops: [
    {
      id: 'stop_1',
      location: { latitude: 37.773, longitude: -122.431 },
      demand: 200,
      serviceTime: 15, // minutes
      timeWindows: [{
        start: '2026-01-16T09:00:00Z',
        end: '2026-01-16T12:00:00Z'
      }]
    },
    // Additional stops...
  ],
  constraints: {
    balanceLoad: true,
    minimizeVehicles: true,
    respectTimeWindows: true
  }
})

// Apply optimized route to vehicles
for (const route of routePlan.routes) {
  await de.lsp.trips.create({
    vehicleId: route.vehicleId,
    stops: route.stops.map(stop => ({
      location: stop.location,
      arrivalTime: stop.arrivalTime,
      departureTime: stop.departureTime
    })),
    startTime: route.startTime,
    endTime: route.endTime,
    distance: route.distance,
    duration: route.duration
  })
}

Fleet Analytics

Gain insights into fleet performance and efficiency:

typescript
// Get fleet utilization analytics
const utilization = await de.lsp.analytics.getFleetUtilization({
  startDate: '2026-01-01',
  endDate: '2026-01-15',
  groupBy: 'day',
  metrics: ['distance', 'activity_hours', 'idle_hours', 'fuel_consumption']
})

// Get vehicle efficiency metrics
const efficiency = await de.lsp.analytics.getVehicleEfficiency({
  vehicleIds: ['veh_123', 'veh_456'],
  startDate: '2026-01-01',
  endDate: '2026-01-15',
  includeComparison: true
})

// Generate fleet performance report
const report = await de.lsp.reports.generate({
  type: 'fleet_performance',
  dateRange: {
    start: '2026-01-01',
    end: '2026-01-15'
  },
  format: 'pdf',
  sections: ['utilization', 'maintenance', 'driver_performance', 'fuel_efficiency']
})

Integration Points

Telematics Integration

Connect with vehicle telematics systems:

  1. Device Connectivity

    • Integrate with OBD-II devices
    • Connect to third-party GPS trackers
    • Support for CAN bus data
  2. Data Processing

    • Real-time telemetry ingestion
    • Historical data storage and analysis
    • Anomaly detection
  3. Diagnostic Support

    • DTC (Diagnostic Trouble Code) handling
    • Vehicle health monitoring
    • Predictive maintenance

Fuel Management

Track and optimize fuel consumption:

  1. Consumption Tracking

    • Automatic fuel level monitoring
    • Fuel purchase integration
    • Efficiency metrics
  2. Cost Management

    • Fuel card integration
    • Expense reporting
    • Budget forecasting
  3. Optimization

    • Idle time reduction recommendations
    • Route efficiency suggestions
    • Driver behavior coaching

ERP & Finance Integration

Connect fleet operations with business systems:

  1. Asset Management

    • Vehicle lifecycle tracking
    • Depreciation calculation
    • TCO (Total Cost of Ownership) analysis
  2. Expense Management

    • Maintenance cost tracking
    • Fuel expense allocation
    • Budget vs. actual reporting
  3. Compliance

    • Regulatory reporting
    • License and registration tracking
    • HOS (Hours of Service) compliance

Benefits

  • Reduced Operating Costs - 15-30% savings through optimization
  • Extended Vehicle Life - Proactive maintenance planning
  • Improved Safety - Driver behavior monitoring and coaching
  • Enhanced Productivity - Efficient routing and dispatching
  • Data-Driven Decisions - Comprehensive analytics

API Reference

For detailed API documentation including endpoints, schemas, and examples:

Next Steps