Skip to main content
Docs menu
POST

/addons/route-optimization/jobs/{jobId}/manual-plans

Save a user-fixed stop sequence as a new plan of a finished job

Same body as the evaluation, plus external_reference. The sequence is evaluated over the job first and must pass the same checks; it is then saved as a new job over the job's orders and vehicles, timed exactly as sent and never reordered: late stops, loads over vehicle_tonnage and days past the working time stay as sent. Orders in no trip come back unassigned with reason NOT_IN_SEQUENCE. Poll the new job and read GET /jobs/:id/result as usual; its engine is 'manual' and parent_job_id names this job. The new job can itself be evaluated, inserted into or saved again. Not a run: no job cap is used, but a trial account may save at most 50 manual plans in 24 hours. Production keys and sales or trial measurement keys only.

Path

POST/api/v1/partners/addons/route-optimization/jobs/{jobId}/manual-plans
Authentication requiredapi-key

curl example

curl -X POST "https://api.route4green.com/api/v1/partners/addons/route-optimization/jobs/{jobId}/manual-plans" \
  -H "api-key: YOUR_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "content-type: application/json" \
  -d '{
  "routes": [
    {
      "external_vehicle_id": "string",
      "trip_index": 0,
      "planned_start": "2026-01-01T00:00:00+07:00",
      "stops": [
        {}
      ]
    }
  ],
  "external_reference": "string"
}'

Parameters

NameInTypeRequiredDescription
jobIdpathstring (uuid)Yes
Idempotency-KeyheaderstringYesUnique per save; a retry with the same body returns the same job

Request body

FieldTypeRequiredDescription
routesobject[]YesThe whole plan to evaluate, one entry per trip; the answer keeps this order
external_referencestringNoClient-supplied identifier for the new plan, echoed back on every read. Absent or blank: the new plan keeps the external_reference of the job it is saved from

Fields of routes

FieldTypeRequiredDescription
external_vehicle_idstringYesA vehicle of the job
trip_indexnumberNoOrder of this trip among the vehicle's trips, 0 first (default 0). Each later trip starts when the previous one is back at the depot plus the turnaround.
planned_startstring (date-time)NoWhen the trip leaves (ISO 8601). Without it, trip 0 leaves at the vehicle's working start and a later trip when the previous one is back plus the turnaround.
stopsRouteOptimizationEvaluationStopDto[]YesThe stops in the order the vehicle serves them; kept exactly as given, never reordered
2 fieldsCreateRouteOptimizationManualPlanDto

Responses

202The new job, as POST /jobs answers
400ROUTE_OPT_VALIDATION_ERROR: the evaluation checks, or a missing Idempotency-Key
403ROUTE_OPT_EVALUATION_NOT_AVAILABLE: sandbox keys and free or self-serve measurement keys
409ROUTE_OPT_EVALUATION_JOB_NOT_FINISHED, ROUTE_OPT_EVALUATION_UNSUPPORTED (more than one planning date), ROUTE_OPT_MANUAL_PLAN_UNSUPPORTED (more than one transport mode), or IDEMPOTENCY_CONFLICT
429ROUTE_OPT_RATE_LIMITED, or ROUTE_OPT_MANUAL_PLAN_LIMIT_REACHED: a trial account already saved 50 manual plans in the last 24 hours

Back to group: Route optimisation

POST /addons/route-optimization/jobs/{jobId}/manual-plans | Route4Green