{"id":2636,"date":"2023-12-18T17:48:09","date_gmt":"2023-12-18T17:48:09","guid":{"rendered":"https:\/\/developers.maplink.global\/example-5-tolls-with-rates-depending-on-origin-and-destination-mexico\/"},"modified":"2025-12-18T17:40:39","modified_gmt":"2025-12-18T17:40:39","slug":"example-tolls-with-rates-depending-on-origin-and-destination-mexico","status":"publish","type":"post","link":"https:\/\/developers.maplink.global\/en\/example-tolls-with-rates-depending-on-origin-and-destination-mexico\/","title":{"rendered":"Example \u2013 Billing by segment"},"content":{"rendered":"\n<ul class=\"wp-block-list\">\n<li><a href=\"#request\">Request<\/a><\/li>\n\n\n\n<li><a href=\"#response\" data-type=\"internal\" data-id=\"#response\">Response<\/a><\/li>\n\n\n\n<li><a href=\"#brasil\" data-type=\"internal\" data-id=\"#brasil\">Example Brazil &#8211; Presidente Dutra Highway Gantries<\/a><\/li>\n\n\n\n<li><a href=\"#chile\" data-type=\"internal\" data-id=\"#chile\">Example Chile &#8211; Autopista Vespucio Oriente Gantries<\/a><\/li>\n\n\n\n<li><a href=\"#mexico\" data-type=\"internal\" data-id=\"#mexico\">Example Mexico &#8211; Toluca &#8211; Naucalpan Highway<\/a><\/li>\n<\/ul>\n\n\n\n<p>This example is specific to roads where billing is conducted by segment\u2014that is, by the combination of an entry and an exit gantry. Thus, the returned value will be proportional to the number of kilometers driven on the road.<\/p>\n\n\n\n<p>For these cases, the type field will return the following options:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>ENTRY_GANTRY <\/code>&#8211; Entry gantries;<\/li>\n\n\n\n<li><code>EXIT_GANTRY <\/code>&#8211; Exit gantries.<\/li>\n<\/ul>\n\n\n\n<p>Values, conditional values, and integration codes will always be returned at the exit gantries, with a reference to the corresponding entry gantry, as shown in the examples below.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>Note:<\/strong> If the route passes only through the exit gantry without any entry gantry for reference, the returned value and integration code will correspond to the segment with the highest possible value.<\/p>\n<\/blockquote>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"request\">Request<\/h2>\n\n\n\n<p>In the request, it will be necessary to add the <code>billing <\/code>parameter with the value <code>FREE_FLOW <\/code>so that the gantries are returned. In the example below, the route passes through an entry gantry and an exit gantry, located on the Presidente Dutra highway in Brazil.<\/p>\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            \"vehicleType\": \"CAR\",\n            \"points\": \"`|_nChbjzGdDjK`AvApCrIp\\\\veAlQtj@jI~WxCjJbS`o@zAvEl@tBFb@x@nCVbArApE\"\n        }\n    ],\n    \"billing\": \"FREE_FLOW\"\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Request with the 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\": \"PFE001\",\n      \"latitude\": -23.4337710259116,\n      \"longitude\": -46.42357024290983\n    },\n    {\n      \"siteId\": \"PFS001\",\n      \"latitude\": -23.450549018021594,\n      \"longitude\": -46.463470746954336\n    }\n  ],\n  \"toll\": {\n    \"vehicleType\": \"CAR\",\n    \"billing\": \"FREE_FLOW\"\n  }\n}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"response\">Response<\/h2>\n\n\n\n<p id=\"response\">As in the previous examples, <code>tollCosts <\/code>contains the total value of tolls for the entire route. Each leg will return a <code>tollCalculation <\/code>object containing a tolls object with the values and information for each toll in the corresponding segment, as well as the <code>legTotalCost<\/code>, which shows the total cost of tolls for that specific leg.<\/p>\n\n\n\n<p id=\"response\">Within each object in <code>tolls<\/code>, we will have the information for each toll, with the following differences:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>For the entry gantry, <code>ENTRY_GANTRY<\/code>, the value returned in price will always be 0. Additionally, no integration code will be returned in the <code>serviceTypes <\/code>field.<\/li>\n\n\n\n<li>For the exit gantry, <code>EXIT_GANTRY<\/code>, the values and integration codes will be returned normally. This data does not refer to the gantry itself, but rather to the segment between the entry gantry and the exit gantry.<\/li>\n<\/ul>\n\n\n\n<p>The following fields will also be returned:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>entryGantryId <\/code>&#8211; ID of the corresponding entry gantry;<\/li>\n\n\n\n<li><code>entryGantryName<\/code> &#8211; Name of the corresponding entry gantry;<\/li>\n\n\n\n<li><code>segmentId<\/code> -ID referring to the segment composed of the entry and exit gantries. It corresponds to the IDs of both gantries concatenated.<\/li>\n<\/ul>\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\": \"3700\",\n                    \"type\": \"ENTRY_GANTRY\",\n                    \"name\": \"PFE001 - Jd. Maria Dirce (km 211)\",\n                    \"address\": \"Jd. Maria Dirce (km 211)\",\n                    \"city\": \"Guarulhos\",\n                    \"state\": {\n                        \"name\": \"SP\",\n                        \"code\": \"SP\"\n                    },\n                    \"country\": \"Brasil\",\n                    \"concession\": \"CCR RioSP\",\n                    \"direction\": \"SOUTH\",\n                    \"coordinates\": {\n                        \"latitude\": -23.43484679,\n                        \"longitude\": -46.42587454\n                    },\n                    \"serviceTypes\": [],\n                    \"price\": 0\n                },\n                {\n                    \"id\": \"3709\",\n                    \"type\": \"EXIT_GANTRY\",\n                    \"name\": \"PFS001 - Aeroporto (km 215)\",\n                    \"address\": \"Aeroporto (km 215)\",\n                    \"city\": \"Guarulhos\",\n                    \"state\": {\n                        \"name\": \"SP\",\n                        \"code\": \"SP\"\n                    },\n                    \"country\": \"Brasil\",\n                    \"concession\": \"CCR RioSP\",\n                    \"direction\": \"SOUTHWEST\",\n                    \"coordinates\": {\n                        \"latitude\": -23.45011179,\n                        \"longitude\": -46.46236207\n                    },\n                    \"serviceTypes\": [\n                        {\n                            \"serviceId\": \"1148\",\n                            \"name\": \"Via Facil\"\n                        }\n                    ],\n                    \"price\": 1.54,\n                    \"segmentId\": \"37003709\",\n                    \"entryGantryId\": \"3700\",\n                    \"entryGantryName\": \"PFE001 - Jd. Maria Dirce (km 211)\"\n                }\n            ],\n            \"legTotalCost\": 1.54,\n            \"vehicleType\": \"CAR\",\n            \"calculationDate\": 1765906825592\n        }\n    ],\n    \"totalCost\": 1.54\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Response with the 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\": \"6941b7a2ad10b369362d622a\",\n    \"clientId\": \"maplink\",\n    \"totalDistance\": 4480,\n    \"totalNominalDuration\": 184,\n    \"averageSpeed\": 75.15,\n    \"tollCosts\": 1.54,\n    \"legs\": [\n        {\n            \"distance\": 4479,\n            \"nominalDuration\": 184,\n            \"averageSpeed\": 75.15,\n            \"points\": \"`|_nChbjzGdDjK`AvApCrIp\\\\veAlQtj@jI~WxCjJbS`o@zAvEl@tBFb@x@nCVbArApE\",\n            \"tollCalculation\": {\n                \"tolls\": [\n                    {\n                        \"id\": \"3700\",\n                        \"type\": \"ENTRY_GANTRY\",\n                        \"name\": \"PFE001 - Jd. Maria Dirce (km 211)\",\n                        \"address\": \"Jd. Maria Dirce (km 211)\",\n                        \"city\": \"Guarulhos\",\n                        \"state\": {\n                            \"name\": \"SP\",\n                            \"code\": \"SP\"\n                        },\n                        \"country\": \"Brasil\",\n                        \"concession\": \"CCR RioSP\",\n                        \"direction\": \"SOUTH\",\n                        \"coordinates\": {\n                            \"latitude\": -23.43484679,\n                            \"longitude\": -46.42587454\n                        },\n                        \"serviceTypes\": [],\n                        \"price\": 0\n                    },\n                    {\n                        \"id\": \"3709\",\n                        \"type\": \"EXIT_GANTRY\",\n                        \"name\": \"PFS001 - Aeroporto (km 215)\",\n                        \"address\": \"Aeroporto (km 215)\",\n                        \"city\": \"Guarulhos\",\n                        \"state\": {\n                            \"name\": \"SP\",\n                            \"code\": \"SP\"\n                        },\n                        \"country\": \"Brasil\",\n                        \"concession\": \"CCR RioSP\",\n                        \"direction\": \"SOUTHWEST\",\n                        \"coordinates\": {\n                            \"latitude\": -23.45011179,\n                            \"longitude\": -46.46236207\n                        },\n                        \"serviceTypes\": [\n                            {\n                                \"serviceId\": \"1148\",\n                                \"name\": \"Via Facil\"\n                            }\n                        ],\n                        \"price\": 1.54,\n                        \"segmentId\": \"37003709\",\n                        \"entryGantryId\": \"3700\",\n                        \"entryGantryName\": \"PFE001 - Jd. Maria Dirce (km 211)\"\n                    }\n                ],\n                \"legTotalCost\": 1.54,\n                \"vehicleType\": \"CAR\",\n                \"calculationDate\": 1765914530047\n            },\n            \"arrivalSiteId\": \"PFS001\",\n            \"departureSiteId\": \"PFE001\"\n        }\n    ],\n    \"source\": \"MAPLINK\",\n    \"createdAt\": 1765914530046,\n    \"expiryIn\": 1766519330046\n}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"brasil\">Example Brazil &#8211; Presidente Dutra Highway Gantries<\/h2>\n\n\n\n<p>The example below is of a route that passes through the Presidente Dutra Highway, where entry and exit gantries were installed on the access ramps to the main road. The route enters the main road through entry gantry <strong>PFE001 <\/strong>and leaves the highway passing through exit gantry <strong>PFS002<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"542\" src=\"https:\/\/developers.maplink.global\/wp-content\/uploads\/2023\/12\/image-6.png\" alt=\"\" class=\"wp-image-3571\" srcset=\"https:\/\/developers.maplink.global\/wp-content\/uploads\/2023\/12\/image-6.png 975w, https:\/\/developers.maplink.global\/wp-content\/uploads\/2023\/12\/image-6-300x167.png 300w, https:\/\/developers.maplink.global\/wp-content\/uploads\/2023\/12\/image-6-768x427.png 768w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\" \/><figcaption class=\"wp-element-caption\">Route on the Presidente Dutra Highway, between gantries PFE001 and PFS002.<\/figcaption><\/figure>\n\n\n\n<p>The complete request can be found below:<\/p>\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  \"points\": [\n    {\n      \"siteId\": \"PFE001\",\n      \"latitude\": -23.4337710259116,\n      \"longitude\": -46.42357024290983\n    },\n    {\n      \"siteId\": \"PFS002\",\n      \"latitude\": -23.496393062325655,\n      \"longitude\": -46.55864556656767\n    }\n  ],\n  \"toll\": {\n    \"vehicleType\": \"CAR\",\n    \"billing\": \"FREE_FLOW\"\n  }\n}<\/pre>\n\n\n\n<p>The response will be returned as shown in the example below:<\/p>\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\": \"693c7582ad10b369362c6eb4\",\n    \"clientId\": \"maplink\",\n    \"totalDistance\": 15549,\n    \"totalNominalDuration\": 638,\n    \"averageSpeed\": 67.68,\n    \"tollCosts\": 3.09,\n    \"legs\": [\n        {\n            \"distance\": 15548,\n            \"nominalDuration\": 638,\n            \"averageSpeed\": 67.68,\n            \"points\": \"`|_nChbjzGdDjK`AvApCrIp\\\\veAlQtj@jI~WxCjJbS`o@zAvEl@tB`HnTvLb`@hC|HbOne@nD~KfHhU|Olj@hAhEjAtErBnIzCpL`D`M|E|QbIb[nA`FfBlIpBzJvDpQpBxIhB~GnAtDdCxGzAtDl@rApCpFrZhj@hJnPjd@hy@jRx]~MpUlL`R`I|LJf@dDhFxCzERb@N^D\\\\@\\\\A^C\\\\CNG\\\\MZ_@t@\",\n            \"tollCalculation\": {\n                \"tolls\": [\n                    {\n                        \"id\": \"3700\",\n                        \"type\": \"ENTRY_GANTRY\",\n                        \"name\": \"PFE001 - Jd. Maria Dirce (km 211)\",\n                        \"address\": \"Jd. Maria Dirce (km 211)\",\n                        \"city\": \"Guarulhos\",\n                        \"state\": {\n                            \"name\": \"SP\",\n                            \"code\": \"SP\"\n                        },\n                        \"country\": \"Brasil\",\n                        \"concession\": \"CCR RioSP\",\n                        \"direction\": \"SOUTH\",\n                        \"coordinates\": {\n                            \"latitude\": -23.43484679,\n                            \"longitude\": -46.42587454\n                        },\n                        \"serviceTypes\": [],\n                        \"price\": 0\n                    },\n                    {\n                        \"id\": \"3710\",\n                        \"type\": \"EXIT_GANTRY\",\n                        \"name\": \"PFS002 - Av. Aricanduva (km 226)\",\n                        \"address\": \"Av. Aricanduva (km 226)\",\n                        \"city\": \"Guarulhos\",\n                        \"state\": {\n                            \"name\": \"SP\",\n                            \"code\": \"SP\"\n                        },\n                        \"country\": \"Brasil\",\n                        \"concession\": \"CCR RioSP\",\n                        \"direction\": \"SOUTHWEST\",\n                        \"coordinates\": {\n                            \"latitude\": -23.49667945,\n                            \"longitude\": -46.55789037\n                        },\n                        \"serviceTypes\": [\n                            {\n                                \"serviceId\": \"1149\",\n                                \"name\": \"Via Facil\"\n                            }\n                        ],\n                        \"price\": 3.09,\n                        \"segmentId\": \"37003710\",\n                        \"entryGantryId\": \"3700\",\n                        \"entryGantryName\": \"PFE001 - Jd. Maria Dirce (km 211)\"\n                    }\n                ],\n                \"legTotalCost\": 3.09,\n                \"vehicleType\": \"CAR\",\n                \"calculationDate\": 1765569922581\n            },\n            \"arrivalSiteId\": \"PFS002\",\n            \"departureSiteId\": \"PFE001\"\n        }\n    ],\n    \"source\": \"MAPLINK\",\n    \"createdAt\": 1765569922581,\n    \"expiryIn\": 1766174722581\n}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"chile\">Example Chile &#8211; Autopista Vespucio Oriente Gantries<\/h2>\n\n\n\n<p>The example below shows a route passing through the <a href=\"https:\/\/www.avo.cl\/mapa-de-la-ruta\">Autopista Vespucio<\/a> Oriente in Chile. Billing on this highway also occurs via entry and exit gantries. The route below enters the highway through the Bilbao entry gantry and exits the highway through the Los Militares exit gantry.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"582\" src=\"https:\/\/developers.maplink.global\/wp-content\/uploads\/2023\/12\/image-7-1024x582.png\" alt=\"\" class=\"wp-image-3577\" srcset=\"https:\/\/developers.maplink.global\/wp-content\/uploads\/2023\/12\/image-7-1024x582.png 1024w, https:\/\/developers.maplink.global\/wp-content\/uploads\/2023\/12\/image-7-300x171.png 300w, https:\/\/developers.maplink.global\/wp-content\/uploads\/2023\/12\/image-7-768x437.png 768w, https:\/\/developers.maplink.global\/wp-content\/uploads\/2023\/12\/image-7.png 1032w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Route on the Autopista Vespucio Oriente, between the Bilbao and Los Militares gantries.<\/figcaption><\/figure>\n\n\n\n<p>The complete request can be found below:<\/p>\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\": \"Entrada\",\n            \"latitude\": -33.43082390803889, \n            \"longitude\":-70.57453931798061\n        },\n        {\n            \"siteId\": \"Salida\",\n            \"latitude\": -33.41139939529261, \n            \"longitude\": -70.5802398377345\n        }\n    ],\n    \"toll\": {\n        \"vehicleType\": \"CAR\",\n        \"billing\": \"FREE_FLOW\"\n    }\n}<\/pre>\n\n\n\n<p>The complete response can be found below:<\/p>\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\": \"6941a837ad10b369362d5acb\",\n    \"clientId\": \"maplink\",\n    \"totalDistance\": 2611,\n    \"totalNominalDuration\": 174,\n    \"averageSpeed\": 50.40,\n    \"tollCosts\": 222.00,\n    \"legs\": [\n        {\n            \"distance\": 2610,\n            \"nominalDuration\": 174,\n            \"averageSpeed\": 50.4,\n            \"points\": \"rm`kExawmL]LWDYDmAJeA@]B[DkGbAg@Hi@Pa@Vu@j@}EtE{NhNgBrAwMfJ}BxAmAn@eGdCmMrEoHrBSFe@@e@Ae@IQGc@UWWKQcA{B_BwESk@s@}Aw@yAgBsD\",\n            \"tollCalculation\": {\n                \"tolls\": [\n                    {\n                        \"id\": \"3570\",\n                        \"type\": \"ENTRY_GANTRY\",\n                        \"name\": \"P\u00f3rtico - Entrada - Bilbao\",\n                        \"address\": \"Autopista Vespucio Oriente\",\n                        \"city\": \" \",\n                        \"state\": {\n                            \"name\": \" \",\n                            \"code\": \" \"\n                        },\n                        \"country\": \"Chile\",\n                        \"concession\": \"Autopista Vespucio Oriente\",\n                        \"direction\": \"NORTH\",\n                        \"coordinates\": {\n                            \"latitude\": -33.43067656,\n                            \"longitude\": -70.57460313\n                        },\n                        \"serviceTypes\": [],\n                        \"price\": 0\n                    },\n                    {\n                        \"id\": \"3566\",\n                        \"type\": \"EXIT_GANTRY\",\n                        \"name\": \"P\u00f3rtico - Salida 1: Los Militares\",\n                        \"address\": \"Los Militares\",\n                        \"city\": \" \",\n                        \"state\": {\n                            \"name\": \" \",\n                            \"code\": \" \"\n                        },\n                        \"country\": \"Chile\",\n                        \"concession\": \"Autopista Vespucio Oriente\",\n                        \"direction\": \"NORTHEAST\",\n                        \"coordinates\": {\n                            \"latitude\": -33.41151269,\n                            \"longitude\": -70.58041115\n                        },\n                        \"serviceTypes\": [],\n                        \"price\": 222.00,\n                        \"segmentId\": \"35703566\",\n                        \"entryGantryId\": \"3570\",\n                        \"entryGantryName\": \"P\u00f3rtico - Entrada - Bilbao\"\n                    }\n                ],\n                \"legTotalCost\": 222.00,\n                \"vehicleType\": \"CAR\",\n                \"calculationDate\": 1765910583099\n            },\n            \"arrivalSiteId\": \"Salida\",\n            \"departureSiteId\": \"Entrada\"\n        }\n    ],\n    \"source\": \"MAPLINK\",\n    \"createdAt\": 1765910583096,\n    \"expiryIn\": 1766515383096\n}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"mexico\">Example Mexico &#8211; Toluca &#8211; Naucalpan Highway<\/h2>\n\n\n\n<p>Some highways in Mexico operate under a <strong>closed toll system<\/strong>, where the amount to be paid is determined by the distance traveled. This control is carried out via entry and exit gantries or toll booths.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"636\" height=\"823\" src=\"https:\/\/developers.maplink.global\/wp-content\/uploads\/2023\/12\/image-9.png\" alt=\"\" class=\"wp-image-3585\" srcset=\"https:\/\/developers.maplink.global\/wp-content\/uploads\/2023\/12\/image-9.png 636w, https:\/\/developers.maplink.global\/wp-content\/uploads\/2023\/12\/image-9-232x300.png 232w\" sizes=\"auto, (max-width: 636px) 100vw, 636px\" \/><figcaption class=\"wp-element-caption\">Closed toll system.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>The example below is of a route on the Toluca &#8211; Naucalpan Highway, managed by the <a href=\"https:\/\/www.autovan.mx\/\">Autovan <\/a>concessionaire, heading towards Chamapa. The route passes through the entry toll booth in Ayotuxco and ends by passing through the Chamapa toll booth. The amount to be paid at the Chamapa toll booth is determined by which entry toll booth was used previously.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"879\" height=\"460\" src=\"https:\/\/developers.maplink.global\/wp-content\/uploads\/2023\/12\/image-8.png\" alt=\"\" class=\"wp-image-3582\" srcset=\"https:\/\/developers.maplink.global\/wp-content\/uploads\/2023\/12\/image-8.png 879w, https:\/\/developers.maplink.global\/wp-content\/uploads\/2023\/12\/image-8-300x157.png 300w, https:\/\/developers.maplink.global\/wp-content\/uploads\/2023\/12\/image-8-768x402.png 768w\" sizes=\"auto, (max-width: 879px) 100vw, 879px\" \/><figcaption class=\"wp-element-caption\">Route on the Toluca &#8211; Naucalpan Highway, between the Ayotuxco and Chamapa toll booths.<\/figcaption><\/figure>\n\n\n\n<p>The complete request for this example can be found below:<\/p>\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\": \"Entrada\",\n            \"latitude\": 19.399862645037803,\n            \"longitude\": -99.38104539680072\n        },\n        {\n            \"siteId\": \"Salida\",\n            \"latitude\": 19.43470773197662, \n            \"longitude\": -99.30359266871034\n        }\n    ],\n    \"toll\": {\n        \"vehicleType\": \"CAR\",\n        \"billing\": \"FREE_FLOW\"\n    }\n}<\/pre>\n\n\n\n<p>The complete response can be found below:<\/p>\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\": \"6941b467ad10b369362d6093\",\n    \"clientId\": \"maplink\",\n    \"totalDistance\": 12516,\n    \"totalNominalDuration\": 567,\n    \"averageSpeed\": 62.55,\n    \"tollCosts\": 68.00,\n    \"legs\": [\n        {\n            \"distance\": 12515,\n            \"nominalDuration\": 567,\n            \"averageSpeed\": 62.55,\n            \"points\": \"c`luBpjq}QEUyA{DQi@i@wBA}EEqAIqAIq@Io@Kg@Oi@[_A[}@Sc@We@_@k@kCuDwBiCgBaBg@c@k@_@kAk@k@Wo@UaBc@mGoAaNaCqB_@iB_@aD_AgBs@mCoAiAk@oAk@}@]{@ScASuAOuAGyDOaAKsAYyAc@}@e@m@_@o@e@e@e@i@m@{@yA[o@Wu@W}@Ka@K{@KgAA}A@s@JsERsGDgEOkBIo@YuAe@uA}@yBsCuGo@cBw@}Cw@oDu@cEq@oDw@mDe@aCm@}CYcA]aA[{@_A_BqEsHWq@_@uAeA_Fs@gCe@aC]iAm@}A_@g@_BiBYY[W_@Ua@Sc@OeA]e@KoAUoAMg@Ci@AmA?k@?wEMwEAk@Ci@I_@EcBc@WIy@a@i@[i@_@g@c@y@_A]e@Yi@_@q@Ws@Ww@Qu@YsBYcEi@uEe@_FGeACwA?_AFaAF_@N_AJ_@JYXu@Ra@Zg@Ze@`AgAb@a@t@q@\\\\U^U`@S^S`@O`@MfAWfAOdAIfAAfADb@Dl@HpAV`HxBdBd@^Hb@Hb@Fb@Bd@Bb@@b@Ad@Ab@Cb@Gb@Gd@Ib@M^M`Aa@`Ae@^Uz@o@t@u@\\\\c@R]Va@R_@Pa@Na@^gA|AiL~@qJZeDNaEBcA@aCDkKJgBRgBNq@Lq@Po@d@_BjAaDjBsE`@kA^iAToAHc@Fe@HmA@kAAkACc@IeAKc@W_A[cAQ_@k@iAs@oAaCqCoA}A{BeCaAqAa@q@u@aBSi@iAqD{@}Be@gAUg@Ye@]i@g@k@k@i@}@u@q@a@{@a@q@Uk@Qw@Oy@O{BUmFe@kAOuHq@yCYmD[_BU_C_@gDa@\",\n            \"tollCalculation\": {\n                \"tolls\": [\n                    {\n                        \"id\": \"2723\",\n                        \"type\": \"ENTRY_GANTRY\",\n                        \"name\": \"Caseta - Ayotuxco\",\n                        \"address\": \"Autopista Toluca - Naucalpan  KM 25+092\",\n                        \"city\": \" \",\n                        \"state\": {\n                            \"name\": \"Estado de M\u00e9xico\",\n                            \"code\": \"Estado de M\u00e9xico\"\n                        },\n                        \"country\": \"M\u00e9xico\",\n                        \"concession\": \"Autovan\",\n                        \"direction\": \"NORTHEAST\",\n                        \"coordinates\": {\n                            \"latitude\": 19.39990472,\n                            \"longitude\": -99.38092579\n                        },\n                        \"serviceTypes\": [],\n                        \"price\": 0\n                    },\n                    {\n                        \"id\": \"1963\",\n                        \"type\": \"EXIT_GANTRY\",\n                        \"name\": \"Caseta - Chamapa\",\n                        \"address\": \"Autopista Toluca - Naucalpan\",\n                        \"city\": \"Ciudad de M\u00e9xico\",\n                        \"state\": {\n                            \"name\": \"Estado de M\u00e9xico\",\n                            \"code\": \"Estado de M\u00e9xico\"\n                        },\n                        \"country\": \"M\u00e9xico\",\n                        \"concession\": \"Autovan\",\n                        \"direction\": \"NORTH\",\n                        \"coordinates\": {\n                            \"latitude\": 19.4345158,\n                            \"longitude\": -99.3035731\n                        },\n                        \"serviceTypes\": [],\n                        \"price\": 68.00,\n                        \"segmentId\": \"27231963\",\n                        \"entryGantryId\": \"2723\",\n                        \"entryGantryName\": \"Caseta - Ayotuxco\"\n                    }\n                ],\n                \"legTotalCost\": 68.00,\n                \"vehicleType\": \"CAR\",\n                \"calculationDate\": 1765913703702\n            },\n            \"arrivalSiteId\": \"Salida\",\n            \"departureSiteId\": \"Entrada\"\n        }\n    ],\n    \"source\": \"MAPLINK\",\n    \"createdAt\": 1765913703701,\n    \"expiryIn\": 1766518503701\n}<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This example is specific to roads where billing is conducted by segment\u2014that is, by the combination of an entry and an exit gantry. Thus, the returned value will be proportional to the number of kilometers driven on the road. For these cases, the type field will return the following options: Values, conditional values, and integration [&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-2636","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\/2636","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=2636"}],"version-history":[{"count":10,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2636\/revisions"}],"predecessor-version":[{"id":3632,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2636\/revisions\/3632"}],"wp:attachment":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/media?parent=2636"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/categories?post=2636"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/tags?post=2636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}