# Get distance in batch

Submit a batch request to find the distance and general drive time between two points.

Endpoint: POST /getDistance

## Header parameters:

  - `Accept` (string, required)
    Format of the response.

  - `Content-Type` (string, required)
    Format of the request.

## Request fields (application/json):

  - `CustomerID` (string, required)
    Required. The [License Key](https://docs.melissa.com/melissa/license/license-information.html) issued by Melissa.
    Example: {REPLACE-WITH-YOUR-LICENSE-KEY}

  - `Options` (string)
    [Options](https://docs.melissa.com/cloud-api/street-route/street-route-reference-guide.html#options) - List options in the following format, with multiple options delimited with a `,`. For example: `optionName:parameter,optionName:parameter`.
These options are case-sensitive and camel case.
- `arriveAt:< yyyy-mm-ddThh:mm:ss.mmmZ >` - Specify the arrival time ISO 8601 UTC.
- `avoid:< borderCrossings | ferries | tollRoads | tunnels | unpavedRoads >` - Specify the types of transport obstacles to avoid.
- `departAt:< yyyy-mm-ddThh:mm:ss.mmmZ | now >` - Specify the departure date and time in ISO 8601 UTC. Default is `now` - departs immediately.
- `routeType:< eco | fastest | shortest | thrilling >` - Specify the type of route.
  - `eco` - Balances travel time and fuel efficiency.
  - `fastest` - Optimizes for fastest travel time.
  - `shortest` - Optimizes for shortest travel distance.
  - `thrilling` - Optimized for challenging, hilly, or winding routes.
- `traffic:< false | true >` - Considers current traffic conditions. Default is `true`.
- `travelMode:< bicycle | car | pedestrian >` - Specify the type of vehicle used for the travel mode. Default is `car`.
- `vehicleCommercial:< false | true >` - Indicates if the vehicle is a commercial vehicle. Default is `false`.
- `vehicleHeight:< [float] | 0 >` - Specifies the vehicle height in meters. There are no height restrictions. Default is `0`.
- `vehicleLength:< [float] | 0 >` - Specifies the vehicle length in meters. Default is `0`.
- `vehicleMaxSpeed:< [integer] | 0 >` - Specifies the maximum vehicle speed in km/hr. Default is `0`.
- `vehicleWeight:< [integer] | 0 >` - Specifies the vehicle weight in kilograms. Minimum value is `1`.
    Example: avoid:tunnels,routeType:shortest

  - `TransmissionReference` (string)
    Transmission Reference - Serves as a unique request identifier. It is returned as sent.
    Example: Test

  - `Units` (string)
    Units - This specifies the returned distance unit scale. Use `mi` for miles and `km` for kilometers.
    Enum: "mi", "km"

  - `Records` (array, required)
    Array of request records.

  - `Records.EndLatitude` (string, required)
    Required. The street route ending latitude.
    Example: 33.64987

  - `Records.EndLongitude` (string, required)
    Required. The street route ending longitude.
    Example: -117.58296

  - `Records.RecordID` (string)
    This is a string value containing a unique identifier for the current record. Use this to match the record submitted with the record returned. It will return what is inputted.

  - `Records.StartLatitude` (string, required)
    Required. The street route starting latitude.
    Example: 33.63752

  - `Records.StartLongitude` (string, required)
    Required. The street route starting longitude.
    Example: -117.60692

## Response 200 fields (application/json):

  - `Version` (string)
    The current service version number.

  - `Units` (string)
    This is a string value that is the set unit of measurement for the TotalDrivingDistance field.

  - `TransmissionReference` (string)
    A pass-through of the input TransmissionReference field.

  - `TransmissionResults` (string)
    Lists error codes from any errors caused by the most recent request as a whole. For more information, see [Street Route Result Codes](https://docs.melissa.com/cloud-api/street-route/result-codes.html).

  - `TotalRecords` (string)
    Total number of records.

  - `Records` (array)
    Array of output records.

  - `Records.RecordID` (string)
    The number of the record. Always `1` for a single request, otherwise it serves as an index of the array of records.

  - `Records.Results` (string)
    Comma delimited status, error codes, and change codes for the record. For more information, see [Street Route Result Codes](https://docs.melissa.com/cloud-api/street-route/result-codes.html).

  - `Records.TravelTime` (string)
    This is a string value of the travel time for the record in the format `hh:mm:ss`.

  - `Records.TotalDrivingDistance` (string)
    This is a string value with the total driving distance. Refer to the Units field to know what unit of measurement it is.

## Response 400 fields (application/json):

  - `type` (string)
    The type of error that occurred.

  - `title` (string)
    A short summary of the error.

  - `status` (integer)
    The HTTP status code for the error.

  - `errors` (object)

  - `errors.$.<PropertyName>` (array)
    A detailed message about the error.

  - `traceId` (string)
    A unique identifier for the request, useful for debugging.

