Trip Cost Estimation¶
Introduction¶
Trip Cost Estimation method provides total estimated cost for a route including tolls. User would still get the response for tolls present on the route in absence of inputs given for fuel cost estimation .
Major features are 1. Toll on route - It enable user to get the information about tolls on the set route, along with that user get value added information like total number of tolls, total cost on the basis of vehicle types, distance, duration, Individal toll details like Toll Name, Toll Cost, address, coordinates, distance, duration and so on.
Note : Default parameter is dependent upon route profile selection 2AxlesAuto for Driving, 2AxlesTruck for Trucking, 2AxlesMoto for Biking
- Fuel Cost Estimation in a trip - Provisioning is done to populate estimated trip cost by passing specific params as input, API Provides/calculates the total estimated cost of any trip which include fuel cost and toll costs.
Implementation¶
Java¶
MapplsCostEstimation mapplsCostEstimation = MapplsCostEstimation.builder()
.routeId(routeId)
.build();
//To call in Foreground Thread
MapplsCostEstimationManager.newInstance(mapplsCostEstimation).call(new OnResponseCallback<CostEstimationResponse>() {
@Override
public void onSuccess(CostEstimationResponse response) {
//handle response
}
@Override
public void onError(int code, String message) {
//handle Error
}
});
//OR
//To call in Background Thread
ApiResponse<CostEstimationResponse> response = MapplsCostEstimationManager.newInstance(mapplsCostEstimation).executeCall();
Kotlin¶
val mapplsCostEstimation = MapplsCostEstimation.builder()
.routeId(routeId)
.build();
//To call in Foreground Thread
MapplsCostEstimationManager.newInstance(mapplsCostEstimation).call(object: OnResponseCallback<CostEstimationResponse> {
override fun onSuccess(response: CostEstimationResponse) {
//handle response
}
override fun onError(code: Int, message: String) {
//handle Error
}
}) //OR
//To call in Background Thread
val response = MapplsCostEstimationManager.newInstance(mapplsCostEstimation).executeCall();
Request Parameters¶
The bold one are mandatory, and the italic one are optional.
a. Mandatory Parameters¶
routeId(String)
: A unique Id created by passing Start and End Location Coordinates.
b. Optional Parameters¶
vehicleType(String)
: Vehicle type accepted values areCostEstimationCriteria.VEHICLE_TYPE_AUTO
: 2AxlesAutoCostEstimationCriteria.VEHICLE_TYPE_BUS
: 2AxlesBusCostEstimationCriteria.VEHICLE_TYPE_LCV
: 2AxlesLCVCostEstimationCriteria.VEHICLE_TYPE_MOTO
: 2AxlesMotoCostEstimationCriteria.VEHICLE_TYPE_TRUCK
: 2AxlesTruckCostEstimationCriteria.VEHICLE_TYPE_HCMEME
: 2AxlesHCMEMECostEstimationCriteria.VEHICLE_TYPE_THREE_AXLES
: 3AxlesCostEstimationCriteria.VEHICLE_TYPE_FOUR_AXLES
: 4AxlesCostEstimationCriteria.VEHICLE_TYPE_FIVE_AXLES
: 5AxlesCostEstimationCriteria.VEHICLE_TYPE_SIX_AXLES
: 6AxlesCostEstimationCriteria.VEHICLE_TYPE_SEVEN_AXLES
: 7Axles
Note : Default parameter is dependent upon route profile selection 2AxlesAuto for Driving, 2AxlesTruck for Trucking, 2AxlesMoto for Biking
vehicleFuelType(String)
: Fuel type of vehicle accepted values are :CostEstimationCriteria.VEHICLE_FUEL_TYPE_PETROL
CostEstimationCriteria.VEHICLE_FUEL_TYPE_ELECTRIC
CostEstimationCriteria.VEHICLE_FUEL_TYPE_DIESEL
CostEstimationCriteria.VEHICLE_FUEL_TYPE_CNG
fuelEfficiency(Integer)
: Value defined to current efficiency of any vehiclefuelEfficiencyUnit(String)
: Unit of Fuel based on fuel type accepted values are:CostEstimationCriteria.UNIT_KM_P_L
CostEstimationCriteria.UNIT_KM_P_UNIT
CostEstimationCriteria.UNIT_KM_P_KG
fuelPrice(Double)
: Price of fuelisTollEnabled(Boolean)
: This parameter is to poupulate/restrict toll data, possible Values are "true" & "false", Default value is set as "false"
Note: Claim provision is mandatory to get response/results.
Response Parameters¶
hasTolls
(Boolean) : Returns true if tolls are available in the given route else false.totalTolls
(Integer): No of tolls available in the given route.locations
(MapplsLocation
) : It contains the array of start, end and way point of route.departureTime
(Long) : The departure time of the user and default value is current timestamp.currency
(String) : Currency and default value is INR.country
(String) : Country name and default value is India.vehicleType
(String) : Types of Vehicle and accepted values are 2AxlesMoto, 2AxlesAuto, 2AxlesBus, 2AxlesHCMEME, 2AxlesLCV, 3Axles, 4Axles, 5Axles, 6Axles, 7Axles.totalTollCost
(Integer) : Total toll cost on basis of tolls falling on the route.url
(String) : Url of the route and it is still in process to provide more meaning full response.distance
(Double) : The estimated distance of the route and the unit is meter.duration
(Double) : The estimated travel time of the route and the unit is seconds.tolls
(List<CostEstimationTollDetail
>): Array of the toll objects fall on the route.fuelEfficiency
(String): Value defined to current efficiency of any vehicletotalFuelCost
(Integer): Total fuel cost calculated by formula (distance X Price)/mileagefuelPrice
(Double) : Price of fuel ; Default is set in case of no selection is "Petrol : 106, Diesel: 100, CNG: 80, EV: 10"vehicleFuelType
(String) : Provided vehcile fuel typetotalTripcostEstimate
(Double) : Total estimated cost of trip[Toll+Fuel] This parameter only appears in case of routes having tolls
CostEstimationTollDetail response Parameter¶
mapplsPin
(String) : Unique Identifier of toll.tollName
(String) : Name of toll.latitude
(Double) : Latitude of toll.longitude
(Double) : Longitude of toll.node
(Double) : Node id of the route where the toll attached.tollGrpId
(Integer) : Toll group Id.road
(String) : Name of the road.roadType
(String) : Type of road.address
(string) : Address of Toll Plaza.state
(String) : State Name.lanes
(Integer) : No of lanes on the toll location.agency
(string) : Toll maintaining agency such as NHAI, MCD.type
(String) : Type of Toll and values are barrier and ticket.averageWaitTimeRange
(Double) : Average Wait time range.nodeIdx
(Integer) : Node index of the toll on the route.payment
(List<String
>) : Mode of payment such as cash, paytm etc.cost
(Integer) : Cost of toll as per selected vehicle.emergency
(String) : Emergency contact information if available.amenities
(List<Strin
>) : Amenities at toll plaza if available.distance
(Double): Indvidual estimated distance.duration
(Double): Indvidual estimated duration.
Note : To fetch all the parameteres in response user has to provsion all the sub template values.
MapplsLocation Response Parameters¶
latitude
(Double) : latitude of the start, end or waypoint.longitude
(Double) : longitude of the start, end or waypoint.
For more details about response templates, please contact apisupport@mappls.com.
For any queries and support, please contact:
Email us at apisupport@mappls.com
Support
Need support? contact us!