{"id":2634,"date":"2023-12-18T17:43:28","date_gmt":"2023-12-18T17:43:28","guid":{"rendered":"https:\/\/developers.maplink.global\/example-4-tolls-with-hourly-rates\/"},"modified":"2025-02-06T18:59:13","modified_gmt":"2025-02-06T18:59:13","slug":"example-tolls-with-hourly-rates","status":"publish","type":"post","link":"https:\/\/developers.maplink.global\/en\/example-tolls-with-hourly-rates\/","title":{"rendered":"Example &#8211; Tolls with hourly rates"},"content":{"rendered":"\n<p>Some toll plazas, especially in Argentina and Chile, have prices that vary according to the day, time or season of the year the route is being traveled.<\/p>\n\n\n\n<p>In Argentina, for example, concessionaires have special rates for peak times, weekends and public holidays, or specific times of the year such as low season and high season.<\/p>\n\n\n\n<p>Below is the tariff table for Argentina&#8217;s <a href=\"https:\/\/www.ausa.com.ar\/sections\/tarifas.html\" data-type=\"link\" data-id=\"https:\/\/www.ausa.com.ar\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">AUSA<\/a> concessionaire, which offers two types of tariff, one for regular hours and one for peak hours.<\/p>\n\n\n\n<p class=\"has-text-align-center\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"749\" src=\"https:\/\/developers.maplink.global\/wp-content\/uploads\/2023\/12\/image-5.png\" alt=\"\" class=\"wp-image-3267\" srcset=\"https:\/\/developers.maplink.global\/wp-content\/uploads\/2023\/12\/image-5.png 1024w, https:\/\/developers.maplink.global\/wp-content\/uploads\/2023\/12\/image-5-300x219.png 300w, https:\/\/developers.maplink.global\/wp-content\/uploads\/2023\/12\/image-5-768x562.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Table with different values \u200b\u200bfor regular time and peak time<\/figcaption><\/figure>\n\n\n\n<p class=\"has-text-align-center\"><\/p>\n\n\n\n<p>In Brazil, this type of tariff is rarer, but some concessionaires already charge different values on weekends and public holidays<\/p>\n\n\n\n<p>In this example we have a route with a 4-axle truck that will pass through the Sarmiento gantry in Argentina. According to the table above, this gantry has conditioning values for peak hours. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Request<\/h2>\n\n\n\n<p>The following parameters will be needed to get the correct value according to the time and day of the week:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>vehicleType<\/code>\u00a0\u2013 Type of vehicle to be considered, in the example it will be\u00a0<code>TRUCK_WITH_TWO_DOUBLE_AXLES<\/code>;<\/li>\n\n\n\n<li><code>calculationDate<\/code>\u00a0\u2013 Date and time in the timestamp format. In this example, we will use the date 02\/06\/2025 at 17:00 (GMT), which corresponds to the timestamp <code>1738861232000<\/code>;<\/li>\n\n\n\n<li><code>conditions<\/code>\u00a0\u2013\u00a0Object that indicates which values \u200b\u200bshould be considered for tolls where there are conditional values, as in this example value by time range and day of the week:\n<ul class=\"wp-block-list\">\n<li><code>period<\/code>\u00a0\u2013 Indicates the period that should be considered to return the exact toll value. In this case, the route will be carried out on a normal day, so the value used in this example will be\u00a0<code>NORMAL<\/code>.<\/li>\n\n\n\n<li><code>billingType<\/code>\u00a0\u2013 Indicates the type of charge that should be considered. The value to be used in this example should be\u00a0<code><code>NORMAL<\/code><\/code>.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Request with Independent endpoint<\/h3>\n\n\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    \"legs\": [\n        {\n            \"points\": \"zh~qEdpncJH[LQHGNGLCPAJBPHHFJNHN@N@XAREV[z@Yx@C@gClE\",\n            \"vehicleType\": \"TRUCK_WITH_TWO_DOUBLE_AXLES\",\n            \"calculationDate\": 1738861232000,\n            \"condition\": {\n                \"period\": \"NORMAL\",\n                \"billingType\": \"NORMAL\"\n            }\n        }\n    ]\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Request with Trip API<\/h3>\n\n\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\": -34.566702,\n      \"longitude\": -58.406596,\n      \"siteId\": \"Point 1\"\n    },\n    {\n      \"latitude\": -34.566436,\n      \"longitude\": -58.408582,\n      \"siteId\": \"Point 2\"\n    }\n  ],\n  \"toll\": {\n    \"vehicleType\": \"TRUCK_WITH_TWO_DOUBLE_AXLES\",\n    \"calculationDate\":1738861232000,\n    \"condition\": {\n            \"period\": \"NORMAL\",\n            \"billingType\": \"NORMAL\"\n        }\n  }\n}<\/pre>\n\n\n\n<p>The result can be seen on the map below:<\/p>\n\n\n\n<p class=\"has-text-align-center\"><img loading=\"lazy\" decoding=\"async\" width=\"703\" height=\"365\" src=\"https:\/\/lh7-us.googleusercontent.com\/6PpKbqzTmGj0Q1Z0JLEmihnHE6zhh1FlIiFv0PGOyk7tHcamCnsjYsntopvAYv_SR_GAO3ktqfczeUyEoVh3XXXOY3BMm9EmZQaqe2AIqY9Fncikkr9S1VYNQDziVIpWCdK3BxBB8hGsOtGLl4WDEJ4\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Response<\/h2>\n\n\n\n<p>Since the time falls within peak hours for the toll in question, the value returned will be <code>2348.84<\/code>, according to the table provided by the concessionaire.<\/p>\n\n\n\n<p>The full responses can be found below.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Response with Independent endpoint<\/h3>\n\n\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    \"legs\": [\n        {\n            \"tolls\": [\n                {\n                    \"id\": \"1032\",\n                    \"name\": \"P\u00f3rtico - Sarmiento\",\n                    \"address\": \"Avenida Sarmiento, 4254\",\n                    \"city\": \" \",\n                    \"state\": {\n                        \"name\": \"Ciudad Autonoma de Buenos Aires\",\n                        \"code\": \"Ciudad Autonoma de Buenos Aires\"\n                    },\n                    \"country\": \"Argentina\",\n                    \"concession\": \"Ausa\",\n                    \"direction\": \"WEST\",\n                    \"coordinates\": {\n                        \"latitude\": -34.5671991,\n                        \"longitude\": -58.4063059\n                    },\n                    \"serviceTypes\": [],\n                    \"price\": 2348.84\n                }\n            ],\n            \"legTotalCost\": 2348.84,\n            \"vehicleType\": \"TRUCK_WITH_TWO_DOUBLE_AXLES\",\n            \"condition\": {\n                \"billingType\": \"NORMAL\",\n                \"period\": \"NORMAL\"\n            },\n            \"calculationDate\": 1738861232000\n        }\n    ],\n    \"totalCost\": 2348.84\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Response with Trip API<\/h3>\n\n\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    \"legs\": [\n        {\n            \"tolls\": [\n                {\n                    \"id\": \"1032\",\n                    \"name\": \"P\u00f3rtico - Sarmiento\",\n                    \"address\": \"Avenida Sarmiento, 4254\",\n                    \"city\": \" \",\n                    \"state\": {\n                        \"name\": \"Ciudad Autonoma de Buenos Aires\",\n                        \"code\": \"Ciudad Autonoma de Buenos Aires\"\n                    },\n                    \"country\": \"Argentina\",\n                    \"concession\": \"Ausa\",\n                    \"direction\": \"WEST\",\n                    \"coordinates\": {\n                        \"latitude\": -34.5671991,\n                        \"longitude\": -58.4063059\n                    },\n                    \"serviceTypes\": [],\n                    \"price\": 2348.84\n                }\n            ],\n            \"legTotalCost\": 2348.84,\n            \"vehicleType\": \"TRUCK_WITH_TWO_DOUBLE_AXLES\",\n            \"condition\": {\n                \"billingType\": \"NORMAL\",\n                \"period\": \"NORMAL\"\n            },\n            \"calculationDate\": 1738861232000\n        }\n    ],\n    \"totalCost\": 2348.84\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Some toll plazas, especially in Argentina and Chile, have prices that vary according to the day, time or season of the year the route is being traveled. In Argentina, for example, concessionaires have special rates for peak times, weekends and public holidays, or specific times of the year such as low season and high season. [&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":[163],"tags":[],"class_list":["post-2634","post","type-post","status-publish","format-standard","hentry","category-toll-en"],"acf":[],"_links":{"self":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2634","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=2634"}],"version-history":[{"count":5,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2634\/revisions"}],"predecessor-version":[{"id":3272,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2634\/revisions\/3272"}],"wp:attachment":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/media?parent=2634"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/categories?post=2634"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/tags?post=2634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}