{"id":2764,"date":"2023-12-20T20:44:24","date_gmt":"2023-12-20T20:44:24","guid":{"rendered":"https:\/\/developers.maplink.global\/example-3-round-trip-freight-calculation\/"},"modified":"2024-03-04T13:30:06","modified_gmt":"2024-03-04T13:30:06","slug":"example-3-round-trip-freight-calculation","status":"publish","type":"post","link":"https:\/\/developers.maplink.global\/en\/example-3-round-trip-freight-calculation\/","title":{"rendered":"Example 3 &#8211; Round trip freight calculation"},"content":{"rendered":"\n<p>On a route between Rio de Janeiro and Belo Horizonte (441 km), a haulier wants to obtain the freight rate for a truck with 7 double axles that will carry soybeans and when it arrives at its destination, it will be loaded with corn that will be transported to the point of origin.<\/p>\n\n<p>The type of operation contracted is &#8220;Cargo vehicle operation only&#8221; (Table B), where a flat rate of $250.00 will be added.<\/p>\n\n<p><strong>Endpoint used:<\/strong> https:\/\/api.maplink.global\/freight\/v1\/calculations (Method: <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">POST<\/mark><\/strong>)<\/p>\n\n<p>The full request can be seen below:<\/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    \"operationType\": [\n        \"B\"\n    ],\n    \"goodsType\": [\n        \"GRANEL_SOLIDO\"\n    ],\n    \"axis\": [\n        7\n    ],\n    \"roundTrip\": true,\n    \"backEmpty\": false,\n    \"distance\": 441,\n    \"otherCosts\": [\n        {\n            \"name\": \"Taxa Fixa\",\n            \"type\": \"FIXED\",\n            \"value\": 250\n        }\n    ],\n    \"date\": \"2021-12-02\"\n}<\/pre>\n\n<p>When you change the value of the <code>roundTrip<\/code> parameter to true, the route distance is automatically multiplied by 2 to obtain the minimum freight calculated for the round trip.<\/p>\n\n<p>The full response can be found below:<\/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    \"source\": \"RESOLU\u00c7\u00c3O N\u00ba 496, DE 19 DE OUTUBRO DE 2021\",\n    \"results\": {\n        \"B\": {\n            \"7\": {\n                \"GRANEL_SOLIDO\": {\n                    \"value\": 4202.81,\n                    \"otherCosts\": {\n                        \"Taxa Fixa\": 250\n                    }\n                }\n            }\n        }\n    },\n    \"minimumFreight\": 4202.81,\n    \"minimumFreightWithCosts\": 4452.81\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>On a route between Rio de Janeiro and Belo Horizonte (441 km), a haulier wants to obtain the freight rate for a truck with 7 double axles that will carry soybeans and when it arrives at its destination, it will be loaded with corn that will be transported to the point of origin. The type [&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":[167],"tags":[],"class_list":["post-2764","post","type-post","status-publish","format-standard","hentry","category-freight-en"],"acf":[],"_links":{"self":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2764","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=2764"}],"version-history":[{"count":1,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2764\/revisions"}],"predecessor-version":[{"id":2765,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2764\/revisions\/2765"}],"wp:attachment":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/media?parent=2764"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/categories?post=2764"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/tags?post=2764"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}