Skip to main content

Shipping by Truck

POST /estimates/shipping-road

Parametertyperequireddefaultdescription
shipmentMassMasstrueMass of the shipment.
vehicleTypeVehicleTypetrueType of the truck.
countryStringtrueCountry of the shipment.
fuelTypeRoadFuelTypefalseFuel type of the vessel.
loadCharacteristicsLoadCharacteristicsfalseLoad characteristics of the shipment.
isTemperatureControlledBooleanfalsefalseWhether the shipment is temperature controlled.
distanceDistancetrue send places if distance is missingDistance of the shipment.
places[Address,Address]true send distance if places is missingTwo addresses for the shipment.
glecVersionStringtruev2Version of the GLEC model to use. "v2" or "v3"

Validation Rules

  • shipmentMass.amount: Must be greater than or equal to 0. Negative weights are not allowed.
  • distance.amount: Must be greater than 0 when provided.
  • distance vs places: Exactly one of distance or places must be provided (mutually exclusive).
  • vehicleType: Must be a valid vehicle type from the supported list.
  • country: Must be a valid country code.
  • glecVersion: Must be either "v2" or "v3".

Return type

Parametertypedescription
idIDID of the estimate
responseMassTotal WTW (well-to-wheel) emissions in tCO2e

Error Responses

The API returns appropriate HTTP status codes and error messages for invalid requests:

400 Bad Request

{
"message": "Bad payload"
}

Common causes:

  • Invalid or missing required parameters
  • Weight validation failure (negative values)
  • Distance validation failure (zero or negative values)
  • Both distance and places provided (mutually exclusive)
  • Invalid vehicle type or country code
Create an estimate
curl -X "POST" "https://logistics.erguvan.co/api/estimates/shipping-road" \
-H 'Authorization: Bearer YOUR_ERGUVAN_API_KEY' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"shipmentMass": {
"amount": 15,
"unit": "t"
},
"glecVersion": "v2",
"vehicleType": "urban_truck",
"country": "TR",
"distance": {
"amount": 300,
"unit": "km"
}
}'