{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/milemaker-com/json-schema/milemaker-com-get-route-plan-batch-response-schema.json",
  "title": "GetRoutePlanBatchResponse",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/milemaker-com-openapi.yml#/components/schemas/GetRoutePlanBatchResponse",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "batchName",
    "createdAt",
    "status",
    "routesTotal",
    "routesRejected",
    "routesSuccess",
    "routesFailed",
    "routeConfiguration"
  ],
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "nullable": false
    },
    "batchName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "nullable": false
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "$ref": "#/$defs/RoutePlanBatchStatus"
    },
    "routesTotal": {
      "type": "integer"
    },
    "routesRejected": {
      "type": "integer"
    },
    "routesSuccess": {
      "type": "integer"
    },
    "routesFailed": {
      "type": "integer"
    },
    "uniqueLocationErrors": {
      "type": "integer"
    },
    "routeConfiguration": {
      "$ref": "#/$defs/RoutePlanBatchConfiguration"
    },
    "uploadUrl": {
      "type": "string"
    },
    "result": {
      "$ref": "#/$defs/RoutePlanBatchResult"
    }
  },
  "$defs": {
    "AvoidType": {
      "description": "Represents a list of road types to be avoided during route calculation.\n\n`roadClosures` avoids roads reported as closed. Guide20 only. Accepted for `practical` and\n`shortest`, not for `fastest`, which always routes around closures using traffic. Not\nlisted means closed roads are not avoided.\n",
      "type": "string",
      "enum": [
        "tolls",
        "highways",
        "dirtRoads",
        "ferries",
        "tunnels",
        "uTurns",
        "borderCrossings",
        "roadClosures"
      ]
    },
    "CostParameters": {
      "description": "The unit cost parameters for fuel cost, fuel consumption rate, maintenance costs, and time costs. Units in USD and miles per gallon. If a particular parameter is omitted, the corresponding total isl not reported in the `CostSummary` portion of the route result.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "fuelPrice": {
          "description": "USD / per gallon",
          "type": "number"
        },
        "fuelEconomy": {
          "description": "miles / per gallon",
          "type": "number",
          "format": "double"
        },
        "maintenanceCost": {
          "description": "USD / per mile",
          "type": "number"
        },
        "laborCost": {
          "description": "USD / per hour",
          "type": "number"
        }
      }
    },
    "HazmatType": {
      "type": "string",
      "enum": [
        "explosive",
        "gas",
        "flammable",
        "combustible",
        "organic",
        "poison",
        "radioactive",
        "corrosives",
        "poisonousInhalation",
        "other"
      ],
      "description": "specifies type of hazardeous load being transported. This informs routing engine about road restrictions and preferred road network to transport this load."
    },
    "RoutePlanBatchConfiguration": {
      "type": "object",
      "description": "Holds a configuration for all batch routes",
      "additionalProperties": false,
      "required": [
        "vehicleType"
      ],
      "properties": {
        "routingType": {
          "$ref": "#/$defs/RoutingType"
        },
        "vehicleType": {
          "$ref": "#/$defs/VehicleType"
        },
        "vehicleParameters": {
          "$ref": "#/$defs/VehicleParameters"
        },
        "hazmatType": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/HazmatType"
          }
        },
        "avoid": {
          "type": "array",
          "description": "Represents a list of road types to be avoided during route calculation",
          "items": {
            "$ref": "#/$defs/AvoidType"
          }
        },
        "costParameters": {
          "$ref": "#/$defs/CostParameters"
        },
        "governorSpeed": {
          "type": "number",
          "description": "Governor speed (mph). When provided and greater than zero, limits the speed of each route segment to this value.",
          "minimum": 1,
          "maximum": 100
        },
        "tollProfile": {
          "$ref": "#/$defs/TollProfile"
        }
      }
    },
    "RoutePlanBatchResult": {
      "description": "Represents result of batch calculation. Appears only when batch is in the completed state.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "jsonReportUrl": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "nullable": false
        },
        "jsonErrorsReportUrl": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "nullable": false
        }
      }
    },
    "RoutePlanBatchStatus": {
      "description": "Represents current status of the batch",
      "type": "string",
      "enum": [
        "pending_upload",
        "processing_upload",
        "in_progress",
        "preparing_results",
        "completed",
        "pending_delete",
        "canceled",
        "processing_update",
        "failed"
      ]
    },
    "RoutingType": {
      "description": "Specifies which optimization is applied during route calculation. The following are intended use cases for each route type.\n\n|  **Route Type**  |  **Description** |\n| ------------     | ---------------- |\n|  `Shortest`      | used for mileage rating, minimizes distance |\n|  `Practical`     | used for mileage rating, minimizes travel duration, uses posted speed limits  |\n|  `Fastest`       | used for trip planning, accepts additional avoid options, trip departure/arrival time, and uses traffic flow to calculate time  |\n",
      "type": "string",
      "enum": [
        "fastest",
        "shortest",
        "practical"
      ],
      "default": "fastest"
    },
    "TollProfile": {
      "type": "object",
      "properties": {
        "transponder": {
          "type": "boolean",
          "default": true
        }
      },
      "description": "Optional parameter, true if vehicle uses transponder"
    },
    "VehicleLengthType": {
      "type": "string",
      "description": "Vehicle length",
      "enum": [
        "straight",
        "48",
        "53",
        "double",
        "triple"
      ]
    },
    "VehicleParameters": {
      "type": "object",
      "description": "Represents vehicle physical parameters. Default values are                  \n|  Property  |  Value |\n| ---------  | ------ |\n|  length    |   '53' |\n|  width     |   102  |\n|  height    |   162  |\n|  weight    |  80000 |\n|  axleCount |    5   |\n",
      "properties": {
        "length": {
          "$ref": "#/$defs/VehicleLengthType"
        },
        "width": {
          "type": "integer",
          "description": "Vehicle width (inches)",
          "minimum": 60,
          "maximum": 102
        },
        "height": {
          "type": "integer",
          "description": "Vehicle height (inches)",
          "minimum": 60,
          "maximum": 240
        },
        "weight": {
          "type": "integer",
          "description": "Vehicle weight (pounds)",
          "minimum": 1500,
          "maximum": 120000
        },
        "axleCount": {
          "type": "integer",
          "description": "Defines total number of axles in the vehicle",
          "minimum": 2,
          "maximum": 10
        }
      }
    },
    "VehicleType": {
      "description": "Represents a type of transport that will travel the route. Vehicle type affects restrictions and preferred road network.",
      "type": "string",
      "enum": [
        "car",
        "truck"
      ]
    }
  }
}