---
title: "Get plan"
method: GET
path: "/lots/{id}/plan"
tags: ["lots"]
---

# Get plan

`GET /lots/{id}/plan`

## Request

- Base URL: `https://api.vepathos.com`
- URL: `https://api.vepathos.com/lots/{id}/plan`
- Auth: API key in header `Authorization`

Returns `state: "PROCESSING"` with `routes: null` while the optimizer works. Once it finishes, this call stores the routes, moves the lot to `PROCESSED` and returns the full plan. Keep calling it until `state` is `PROCESSED`; stops are charged at that moment.

Returns `404` before any plan was queued.

## Path parameters

- `id` integer, required

## Response `200`

The plan, or a short poll response while it is still running.

- DeliveryPlanResponse: Poll response while running (`state` `PROCESSING` or `OPTIMIZING`, `routes` null) or the full plan once `state` is `PROCESSED`.
  - `state` 'UNPROCESSED' | 'PROCESSING' | 'OPTIMIZING' | 'PROCESSED' | 'CANCELED', required
  - `routes` RouteResponse[], nullable: Optimized routes. `null` while the plan is still running.
    - `id` string, required
    - `milestone` MilestoneResponse, required
      - `name` string, required: Display name.
      - `location` string, required: Coordinates in ISO 6709 decimal degrees, latitude then longitude with signs, e.g. `+40.7128-74.0060`.
      - `category` 'DEPOT' | 'DISTRIBUTION_CENTER' | 'LOADING_POINT' | 'WAREHOUSE' | 'TRANSFER_POINT'
      - `id` union, required
        - string
        - integer
    - `deliveries` DeliveryResponse[], required
      - `destination` string, required: Stop location. Coordinates in ISO 6709 decimal degrees, latitude then longitude with signs, e.g. `+40.7128-74.0060`.
      - `method` 'DELIVERY' | 'PICKUP' | 'SIGNATURE'
      - `schedules` string[], nullable: Time windows. RFC 5545 VEVENT: `DTSTART` plus `DTEND` or `DURATION`, optionally `RRULE`. Join lines with `\n`.
      - `width` integer, nullable: Package width, in `length_unit`. Integer.
      - `height` integer, nullable: Package height, in `length_unit`. Integer.
      - `depth` integer, nullable: Package depth, in `length_unit`. Integer.
      - `length_unit` 'CENTIMETER' | 'METER' | 'KILOMETER' | 'INCH' | 'FEET' | 'MILE'
      - `volume` integer, nullable: Package volume, in `volume_unit`. Integer.
      - `volume_unit` 'CUBIC_CENTIMETER' | 'CUBIC_METER' | 'LITER' | 'CUBIC_INCH' | 'CUBIC_FEET' | 'GALLON'
      - `weight` integer, nullable: Package weight, in `weight_unit`. Integer; use `GRAMS` for fractional kilograms.
      - `weight_unit` 'GRAMS' | 'KILOGRAMS' | 'OUNCES' | 'POUNDS'
      - `packaging` 'BOX' | 'ENVELOPE' | 'BAG' | 'CARTON' | 'PALLET' | 'SHRINK_WRAP'
      - `handling` SpecialHandling[], nullable
      - `value_cents` integer, nullable: Declared value in minor units (`5000` is 50.00).
      - `value_currency` string, nullable: ISO 4217 currency code.
      - `extra` unknown
      - `id` union, required
        - string
        - integer
      - `milestone` MilestoneResponse, required
        - `name` string, required: Display name.
        - `location` string, required: Coordinates in ISO 6709 decimal degrees, latitude then longitude with signs, e.g. `+40.7128-74.0060`.
        - `category` 'DEPOT' | 'DISTRIBUTION_CENTER' | 'LOADING_POINT' | 'WAREHOUSE' | 'TRANSFER_POINT'
        - `id` union, required
          - string
          - integer
      - `arrival_time` union: Estimated arrival in minutes after midnight, including the route start from `config.schedule.start_at`. Present on deliveries inside plan routes.
        - number
        - string
    - `vehicle` VehicleResponse
      - `name` string, required: Display name.
      - `volume` integer, nullable: Cargo volume capacity, in `volume_unit`. Integer.
      - `volume_unit` 'CUBIC_CENTIMETER' | 'CUBIC_METER' | 'LITER' | 'CUBIC_INCH' | 'CUBIC_FEET' | 'GALLON'
      - `weight` integer, nullable: Maximum payload, in `weight_unit`. Integer.
      - `weight_unit` 'GRAMS' | 'KILOGRAMS' | 'OUNCES' | 'POUNDS'
      - `consumption` integer, nullable: Fuel or energy consumption, in `consumption_unit`. Integer.
      - `consumption_unit` 'LITERS_PER_100KM' | 'KILOMETERS_PER_LITER' | 'MILES_PER_GALLON' | 'GALLONS_PER_MILE'
      - `category_type` 'TRUCK' | 'VAN' | 'PICKUP' | 'MOTORCYCLE' | 'BICYCLE'
      - `engine_type` 'GASOLINE' | 'DIESEL' | 'CNG' | 'ELECTRIC' | 'HYBRID' | 'MECHANIC'
      - `id` union, required
        - string
        - integer
    - `driver` DriverResponse
      - `first_name` string, required
      - `last_name` string, nullable
      - `work_schedules` string[], nullable: Working hours. RFC 5545 VEVENT: `DTSTART` plus `DTEND` or `DURATION`, optionally `RRULE`. Join lines with `\n`.
      - `start_point` string, nullable: Where the driver starts the day. Coordinates in ISO 6709 decimal degrees, latitude then longitude with signs, e.g. `+40.7128-74.0060`.
      - `end_point` string, nullable: Where the driver ends the day. Coordinates in ISO 6709 decimal degrees, latitude then longitude with signs, e.g. `+40.7128-74.0060`.
      - `work_areas` array[], nullable: Polygons, each an array of `geo_point` vertices.
        - string[]
      - `id` union, required
        - string
        - integer
      - `vehicles` DriverVehicleResponse[], nullable: Vehicle types the driver can operate.
        - `name` string, required
        - `volume` integer, nullable
        - `volume_unit` 'CUBIC_CENTIMETER' | 'CUBIC_METER' | 'LITER' | 'CUBIC_INCH' | 'CUBIC_FEET' | 'GALLON'
        - `weight` integer, nullable
        - `weight_unit` 'GRAMS' | 'KILOGRAMS' | 'OUNCES' | 'POUNDS'
        - `consumption` integer, nullable
        - `consumption_unit` 'LITERS_PER_100KM' | 'KILOMETERS_PER_LITER' | 'MILES_PER_GALLON' | 'GALLONS_PER_MILE'
        - `category_type` 'TRUCK' | 'VAN' | 'PICKUP' | 'MOTORCYCLE' | 'BICYCLE'
        - `engine_type` 'GASOLINE' | 'DIESEL' | 'CNG' | 'ELECTRIC' | 'HYBRID' | 'MECHANIC'
        - `id` union, required
          - string
          - integer
        - `qty` integer, required
    - `route_id` string
    - `route_index` integer
    - `route_geometry` array[]
      - number[]
    - `optimized_waypoints` OptimizedWaypoint[]
      - `order` integer
      - `lat` number
      - `lng` number
      - `delivery_id` string: Delivery id for this stop (mapped from package_id).
      - `arrival_time` union: Estimated arrival in minutes after midnight, including the route start.
        - number
        - string
    - `stops` OptimizedWaypoint[]
      - `order` integer
      - `lat` number
      - `lng` number
      - `delivery_id` string: Delivery id for this stop (mapped from package_id).
      - `arrival_time` union: Estimated arrival in minutes after midnight, including the route start.
        - number
        - string
    - `arrival_times` union[]
      - union
        - number
        - string
    - `total_distance_km` number
    - `total_duration_sec` number
    - `total_packages` integer
    - `load_percentage` number
    - `tw_stats` object
  - `delivery_paths` RoutePathData[], nullable: Per-route optimizer payloads (route_data), including optimized_waypoints and arrival_times.
    - `route_id` string
    - `route_index` integer
    - `route_geometry` array[]
      - number[]
    - `optimized_waypoints` OptimizedWaypoint[]
      - `order` integer
      - `lat` number
      - `lng` number
      - `delivery_id` string: Delivery id for this stop (mapped from package_id).
      - `arrival_time` union: Estimated arrival in minutes after midnight, including the route start.
        - number
        - string
    - `stops` OptimizedWaypoint[]: Alias of optimized_waypoints.
      - `order` integer
      - `lat` number
      - `lng` number
      - `delivery_id` string: Delivery id for this stop (mapped from package_id).
      - `arrival_time` union: Estimated arrival in minutes after midnight, including the route start.
        - number
        - string
    - `arrival_times` union[]
      - union
        - number
        - string
    - `total_distance_km` number
    - `total_duration_sec` number
    - `num_points` integer
  - `totals` DeliveryPlanTotals
    - `total_routes` integer
    - `total_points` integer
    - `submitted_points` integer: Stops submitted to the optimizer (may exceed total_points when some are rejected).
    - `unserved_points` integer: Submitted stops not assigned to any route.
    - `total_distance_km` number
    - `total_duration_sec` number
    - `execution_time_sec` number
    - `rejection_summary` object: Counts of rejections by reason code.
    - `rejected_deliveries` object[]: Per-delivery rejection details from the optimizer.
    - `fleet_metrics` object
    - `time_windows_global` object
  - `session_id` string, uuid: Optimizer run id. Poll `GET /lots/{id}/plan/status` for progress while `state` is `PROCESSING`.
  - `optimizer_session_id` string, uuid: Alias of session_id (same optimizer task UUID).

## Other responses

- `401`: Missing, expired or invalid access token.
- `404`: The resource does not exist in your account.
- `422`: The body or a parameter does not match the schema.

---

[API](https://skmtc.dev/vepathos/apis/vepathos-route-optimization-api.md) · [All operations](https://skmtc.dev/vepathos/apis/vepathos-route-optimization-api/llms.txt) · [OpenAPI document](https://skmtc.dev/vepathos/apis/vepathos-route-optimization-api/revisions/00caa1ca62d9?raw)
