{"id":2553,"date":"2023-12-14T23:33:20","date_gmt":"2023-12-14T23:33:20","guid":{"rendered":"https:\/\/developers.maplink.global\/calculating-tolls-on-stretches-with-varying-axles\/"},"modified":"2024-02-29T14:30:35","modified_gmt":"2024-02-29T14:30:35","slug":"calculating-tolls-on-stretches-with-varying-axles","status":"publish","type":"post","link":"https:\/\/developers.maplink.global\/en\/calculating-tolls-on-stretches-with-varying-axles\/","title":{"rendered":"Calculating tolls on stretches with varying axles"},"content":{"rendered":"\n<p>In addition to allowing tolls to be calculated on the route, the Trip API allows <strong>different types of vehicles to be specified for specific sections of the route<\/strong>.<strong> <\/strong>Ideal for routes that<strong> use different types of vehicles or for routes where vehicle axles are raised\/lowered on certain sections<\/strong>.<\/p>\n\n<p>In the following example, we have a route between S\u00e3o Paulo and Mat\u00e3o, which passes through different cities. The route will be made with a 4 double axle vehicle, however, one of the axles will be suspended on the stretch from Jundia\u00ed to Rio Claro, and on the stretch from Rio Claro to S\u00e3o Carlos another axle will be suspended. After S\u00e3o Carlos, all the axles will be lowered to their final destination.<\/p>\n\n<p>To do this, you need to add the following parameters inside toll:<\/p>\n\n<ul class=\"wp-block-list\">\n<li><code>vehicleType<\/code>  &#8211; Type of vehicle used during the route;<\/li>\n\n\n\n<li><code>variableAxles<\/code>  &#8211; Array of objects with the specific rules for each section. Each object must contain the following parameters:\n<ul class=\"wp-block-list\">\n<li><code>fromSiteId<\/code>  &#8211; String with the ID of the starting point where the new rule should be applied;<\/li>\n\n\n\n<li><code>toSiteId<\/code>  &#8211; String with the ID of the end point of the section where the new rule is to be applied;<\/li>\n\n\n\n<li><code>newVehicleType<\/code>  &#8211; New type of vehicle to be considered for the stretch in question.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n<p>The points referenced in <code>fromSiteId<\/code> and <code>toSiteId<\/code> must be listed in the points parameter and must have the same name used in siteId. At <code>vehicleType<\/code> and <code>newVehicleType<\/code>, the following values are possible:<\/p>\n\n<ul class=\"wp-block-list\">\n<li><code>MOTORCYCLE<\/code><\/li>\n\n\n\n<li><code>CAR<\/code><\/li>\n\n\n\n<li><code>CAR_WITH_THREE_SIMPLE_AXLES<\/code><\/li>\n\n\n\n<li><code>CAR_WITH_FOUR_SIMPLE_AXLES<\/code><\/li>\n\n\n\n<li><code>BUS_WITH_TWO_DOUBLE_AXLES<\/code><\/li>\n\n\n\n<li><code>BUS_WITH_THREE_DOUBLE_AXLES<\/code><\/li>\n\n\n\n<li><code>BUS_WITH_FOUR_DOUBLE_AXLES<\/code><\/li>\n\n\n\n<li><code>BUS_WITH_FIVE_DOUBLE_AXLES<\/code><\/li>\n\n\n\n<li><code>TRUCK_WITH_TWO_SINGLE_AXIS<\/code><\/li>\n\n\n\n<li><code>TRUCK_WITH_TWO_DOUBLE_AXLES<\/code><\/li>\n\n\n\n<li><code>TRUCK_WITH_THREE_DOUBLE_AXLES<\/code><\/li>\n\n\n\n<li><code>TRUCK_WITH_FOUR_DOUBLE_AXLES<\/code><\/li>\n\n\n\n<li><code>TRUCK_WITH_FIVE_DOUBLE_AXLES<\/code><\/li>\n\n\n\n<li><code>TRUCK_WITH_SIX_DOUBLE_AXLES<\/code><\/li>\n\n\n\n<li><code>TRUCK_WITH_SEVEN_DOUBLE_AXLES<\/code><\/li>\n\n\n\n<li><code>TRUCK_WITH_EIGHT_DOUBLE_AXLES<\/code><\/li>\n\n\n\n<li><code>TRUCK_WITH_NINE_DOUBLE_AXLES<\/code><\/li>\n\n\n\n<li><code>TRUCK_WITH_TEN_DOUBLE_AXLES<\/code><\/li>\n<\/ul>\n\n<p>Below is a complete example of what the request would look like for the route between S\u00e3o Paulo and Mat\u00e3o detailed above:<\/p>\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n    \"calculationMode\": \"THE_FASTEST\",\n    \"points\": [\n        {\n            \"latitude\": -23.555771,\n            \"longitude\": -46.639557,\n            \"siteId\": \"SP\"\n        },\n        {\n            \"latitude\": -23.18567,\n            \"longitude\": -46.88926,\n            \"siteId\": \"JUNDIAI\"\n        },\n        {\n            \"latitude\": -22.905082,\n            \"longitude\": -47.061333,\n            \"siteId\": \"CAMPINAS\"\n        },\n        {\n            \"latitude\": -22.410765,\n            \"longitude\": -47.559621,\n            \"siteId\": \"RIO CLARO\"\n        },\n        {\n            \"latitude\": -22.017056,\n            \"longitude\": -47.889687,\n            \"siteId\": \"S\u00c3O CARLOS\"\n        },\n        {\n            \"latitude\": -21.779084,\n            \"longitude\": -48.179264,\n            \"siteId\": \"ARARAQUARA\"\n        },\n        {\n            \"latitude\": -21.605827,\n            \"longitude\": -48.362041,\n            \"siteId\": \"MAT\u00c3O\"\n        }\n    ],\n    \"toll\": {\n        \"vehicleType\": \"TRUCK_WITH_FOUR_DOUBLE_AXLES\",\n        \"variableAxles\": [\n            {\n                \"fromSiteId\": \"JUNDIAI\",\n                \"toSiteId\": \"RIO CLARO\",\n                \"newVehicleType\": \"TRUCK_WITH_THREE_DOUBLE_AXLES\"\n            },\n            {\n                \"fromSiteId\": \"RIO CLARO\",\n                \"toSiteId\": \"S\u00c3O CARLOS\",\n                \"newVehicleType\": \"TRUCK_WITH_TWO_DOUBLE_AXLES\"\n            }\n        ]\n    }\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In addition to allowing tolls to be calculated on the route, the Trip API allows different types of vehicles to be specified for specific sections of the route. Ideal for routes that use different types of vehicles or for routes where vehicle axles are raised\/lowered on certain sections. In the following example, we have a [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[161],"tags":[],"class_list":["post-2553","post","type-post","status-publish","format-standard","hentry","category-trip-en"],"acf":[],"_links":{"self":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2553","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/comments?post=2553"}],"version-history":[{"count":1,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2553\/revisions"}],"predecessor-version":[{"id":2554,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2553\/revisions\/2554"}],"wp:attachment":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/media?parent=2553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/categories?post=2553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/tags?post=2553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}