{"id":2632,"date":"2023-12-18T17:37:08","date_gmt":"2023-12-18T17:37:08","guid":{"rendered":"https:\/\/developers.maplink.global\/example-3-discounted-tolls-through-automatic-payment\/"},"modified":"2025-02-06T18:34:22","modified_gmt":"2025-02-06T18:34:22","slug":"example-discounted-tolls-through-automatic-payment","status":"publish","type":"post","link":"https:\/\/developers.maplink.global\/en\/example-discounted-tolls-through-automatic-payment\/","title":{"rendered":"Example &#8211; Discounted tolls through automatic payment"},"content":{"rendered":"\n<p>Some toll plazas offer a percentage discount for users who use automatic payment methods, known as TAG or <em>TelePeaje<\/em>.  <\/p>\n\n\n\n<p>In Brazil, this percentage is 5% off and is available to only a few dealerships that offer the service. This percentage may vary in other countries. In Argentina, for example, the <a href=\"https:\/\/www.crusa.com.ar\/tarifas\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Caminos del R\u00edo Uruguay<\/a> dealership offers a 15% discount to users who use the tag, or <em>TelePeaje<\/em>.  <\/p>\n\n\n\n<p>In the following example, we have a route using a single-axle truck that passes through the Parapu\u00e3 toll, in Brazil, which offers a 5% discount.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Request<\/h2>\n\n\n\n<p>The following parameters will be required to obtain the value with the TAG discount already applied:<\/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>conditions<\/code>\u00a0\u2013\u00a0Object that indicates which values \u200b\u200bshould be considered for tolls where there are conditional values, such as in this example a discounted value for vehicles with TAG:\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 <code>TAG<\/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\": \"`fidCffqtHo@t@u@hAm@p@yCvEe@v@aBvBqAjBeA~A\",\n            \"vehicleType\": \"TRUCK_WITH_TWO_DOUBLE_AXLES\",\n            \"condition\": {\n                \"period\": \"NORMAL\",\n                \"billingType\": \"TAG\"\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            \"siteId\": \"Point 1\",\n            \"latitude\": -21.843015408682692,\n            \"longitude\": -50.71983853381955\n        },\n        {\n            \"siteId\": \"Point 2\",\n            \"latitude\": -21.840092392777727,\n            \"longitude\": -50.72374936513232\n        }\n    ],\n    \"toll\": {\n        \"vehicleType\": \"TRUCK_WITH_TWO_DOUBLE_AXLES\",\n        \"condition\": {\n            \"period\": \"NORMAL\",\n            \"billingType\": \"TAG\"\n        }\n    }\n}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Response<\/h2>\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\": \"828\",\n                    \"name\": \"Ped\u00e1gio - Parapu\u00e3\",\n                    \"address\": \"SP294, KM551+500\",\n                    \"city\": \"Parapu\u00e3\",\n                    \"state\": {\n                        \"name\": \"S\u00e3o Paulo\",\n                        \"code\": \"SP\"\n                    },\n                    \"country\": \"Brasil\",\n                    \"concession\": \"Eixo-SP\",\n                    \"direction\": \"WEST\",\n                    \"coordinates\": {\n                        \"latitude\": -21.840998367867602,\n                        \"longitude\": -50.722601401095574\n                    },\n                    \"serviceTypes\": [\n                        {\n                            \"serviceId\": \"791\",\n                            \"name\": \"Via Facil\"\n                        },\n                        {\n                            \"serviceId\": \"35352945515000103\",\n                            \"name\": \"ANTTCODE\"\n                        }\n                    ],\n                    \"price\": 19.76\n                }\n            ],\n            \"legTotalCost\": 19.76,\n            \"vehicleType\": \"TRUCK_WITH_TWO_DOUBLE_AXLES\",\n            \"condition\": {\n                \"billingType\": \"TAG\",\n                \"period\": \"NORMAL\"\n            },\n            \"calculationDate\": 1738853654511\n        }\n    ],\n    \"totalCost\": 19.76\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  \"id\": \"67a4ccd6361dc514265d966f\",\n  \"clientId\": \"maplink\",\n  \"totalDistance\": 518,\n  \"totalNominalDuration\": 37,\n  \"averageSpeed\": 64.8,\n  \"tollCosts\": 19.76,\n  \"legs\": [\n      {\n          \"distance\": 518,\n          \"nominalDuration\": 37,\n          \"averageSpeed\": 64.8,\n          \"points\": \"`fidCffqtHo@t@u@hAm@p@yCvEe@v@aBvBqAjBeA~A\",\n          \"tollCalculation\": {\n              \"tolls\": [\n                  {\n                      \"id\": \"828\",\n                      \"name\": \"Ped\u00e1gio - Parapu\u00e3\",\n                      \"address\": \"SP294, KM551+500\",\n                      \"city\": \"Parapu\u00e3\",\n                      \"state\": {\n                          \"name\": \"S\u00e3o Paulo\",\n                          \"code\": \"SP\"\n                      },\n                      \"country\": \"Brasil\",\n                      \"concession\": \"Eixo-SP\",\n                      \"direction\": \"WEST\",\n                      \"coordinates\": {\n                          \"latitude\": -21.840998367867602,\n                          \"longitude\": -50.722601401095574\n                      },\n                      \"serviceTypes\": [\n                          {\n                              \"serviceId\": \"791\",\n                              \"name\": \"Via Facil\"\n                          },\n                          {\n                              \"serviceId\": \"35352945515000103\",\n                              \"name\": \"ANTTCODE\"\n                          }\n                      ],\n                      \"price\": 19.76\n                  }\n              ],\n              \"legTotalCost\": 19.76,\n              \"vehicleType\": \"TRUCK_WITH_TWO_DOUBLE_AXLES\",\n              \"calculationDate\": 1738853590334,\n              \"condition\": {\n                  \"billingType\": \"TAG\",\n                  \"period\": \"NORMAL\"\n              }\n          }\n      }\n  ],\n  \"crossedBorders\": [],\n  \"source\": \"MAPLINK\",\n  \"createdAt\": 1738853590348,\n  \"expiryIn\": 1739458390249\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Some toll plazas offer a percentage discount for users who use automatic payment methods, known as TAG or TelePeaje. In Brazil, this percentage is 5% off and is available to only a few dealerships that offer the service. This percentage may vary in other countries. In Argentina, for example, the Caminos del R\u00edo Uruguay dealership [&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-2632","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\/2632","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=2632"}],"version-history":[{"count":5,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2632\/revisions"}],"predecessor-version":[{"id":3258,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2632\/revisions\/3258"}],"wp:attachment":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/media?parent=2632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/categories?post=2632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/tags?post=2632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}