PlanSolve is still in pre-alpha – Features may change or break. Feedback welcome!

Field service solver

Route optimization for field technicians and service vehicles

Field service solver

Optimize routes for field technicians, service vehicles, and mobile workers. PlanSolve's field service model handles complex constraints including time windows, skill requirements, vehicle capacity, and real-time traffic conditions.

API Overview

PlanSolve uses an asynchronous API pattern for field service optimization. Submit your request, monitor progress, and retrieve results when complete.

POST/api/solve

Submit a field service optimization request

GET/api/solve/{jobId}

Check the status of an optimization job

GET/api/solve/{jobId}/result

Retrieve the completed optimization results

GET/api/solve/{jobId}/analyze

Analyze the optimization results

API Workflow

All PlanSolve optimization APIs follow the same workflow. Understanding this process will help you integrate the API effectively.

1

Construct Request

Build your optimization request with vehicles, visits, and constraints

2

Start Solver

Submit the request to start the optimization process

3

Poll Status

Check the status until the solver completes

4

Get Results

Retrieve the optimized routes and schedules

Workflow Details

Step 1: Create your request object with vehicle data (locations, skills, shifts, capacity) and visit data (locations, time windows, required skills, service duration).

Step 2: Send a POST request to /api/solve with your request data. The API will return a job ID.

Step 3: Poll the status endpoint /api/solve/{jobId} until the status changes from "solving" to "completed".

Step 4: Once completed, retrieve the results from /api/solve/{jobId}/result to get the optimized routes and schedules.

API Parameters

The field service optimization API accepts these key parameters to define your optimization problem. Each parameter plays a crucial role in determining the optimal solution.

Main Parameters

ParameterTypeRequiredDescriptionExample
vehiclesarrayRequiredArray of vehicles/technicians with their constraints and capabilities[{ "id": "tech1", "homeLocation": [lat, lng], "skills": ["repair"], "shifts": [...] }]
visitsarrayRequiredArray of customer visits with locations, time windows, and requirements[{ "id": "visit1", "location": [lat, lng], "timeWindows": [...], "requiredSkills": ["repair"] }]
startDateTimeISO 8601RequiredStart time for the optimization period"2024-01-15T08:00:00"
endDateTimeISO 8601RequiredEnd time for the optimization period"2024-01-15T18:00:00"
southWestCornerarray[number]OptionalSouthwest boundary coordinates [lat, lng] for the service area[40.74, -74.01]
northEastCornerarray[number]OptionalNortheast boundary coordinates [lat, lng] for the service area[40.76, -73.98]

Vehicle Parameters

ParameterTypeRequiredDescriptionExample
idstringRequiredUnique identifier for the vehicle/technician"tech1"
homeLocationarray[number]RequiredStarting location coordinates [lat, lng][40.7128, -74.0060]
skillsarray[string]OptionalList of skills the technician possesses["repair", "installation"]
shiftsarray[object]RequiredArray of work shifts with time constraints[{"id": "morning", "minStartTime": "08:00", "maxEndTime": "17:00"}]

Visit Parameters

ParameterTypeRequiredDescriptionExample
idstringRequiredUnique identifier for the visit"visit1"
namestringOptionalHuman-readable name for the visit"Customer Repair"
locationarray[number]RequiredVisit location coordinates [lat, lng][40.7589, -73.9851]
timeWindowsarray[object]OptionalAvailable time slots for the visit[{"minStartTime": "09:00", "maxEndTime": "17:00"}]
serviceDurationstringRequiredDuration of service in ISO 8601 format"PT30M"
prioritystringOptionalVisit priority level (HIGH, MEDIUM, LOW)"HIGH"
requiredSkillsarray[string]OptionalSkills required to complete this visit["repair"]

JSON Request Structure

Understand the complete structure of a field service optimization request. This example shows all the key components and their relationships.

{
  "vehicles": [
    {
      "id": "tech1",
      "homeLocation": [40.7128, -74.0060],
      "skills": ["repair", "installation"],
      "shifts": [
        {
          "id": "morning",
          "minStartTime": "08:00",
          "maxEndTime": "17:00"
        }
      ]
    }
  ],
  "visits": [
    {
      "id": "visit1",
      "name": "Customer Repair",
      "location": [40.7589, -73.9851],
      "timeWindows": [
        {
          "minStartTime": "09:00",
          "maxEndTime": "17:00"
        }
      ],
      "serviceDuration": "PT30M",
      "priority": "HIGH",
      "requiredSkills": ["repair"]
    }
  ],
  "startDateTime": "2024-01-15T08:00:00",
  "endDateTime": "2024-01-15T18:00:00",
  "southWestCorner": [40.74, -74.01],
  "northEastCorner": [40.76, -73.98]
}

API & SDK

Choose between direct API integration or our official SDKs. Both approaches provide full access to PlanSolve's field service optimization capabilities.

🌐

REST API

Direct HTTP integration with full control

View API
🔷

SDKs

Use your preferred language to interact with PlanSolve's API.

View SDKs

Ready to Optimize Your Field Service?

Start with our quick start guide to implement field service optimization in your application.