{"id":2762,"date":"2023-12-20T20:42:41","date_gmt":"2023-12-20T20:42:41","guid":{"rendered":"https:\/\/developers.maplink.global\/example-2-freight-calculation-with-multiple-values\/"},"modified":"2024-03-04T13:29:36","modified_gmt":"2024-03-04T13:29:36","slug":"example-2-freight-calculation-with-multiple-values","status":"publish","type":"post","link":"https:\/\/developers.maplink.global\/en\/example-2-freight-calculation-with-multiple-values\/","title":{"rendered":"Example 2 &#8211; Freight calculation with multiple values"},"content":{"rendered":"\n<p>In this example, the haulier wants to obtain the minimum freight rates for a route between S\u00e3o Paulo and Santos (81 km) &#8211; one-way &#8211; which will be carried out by 2 trucks with the following logistical and contractual specifications:<\/p>\n\n<p><strong>Truck 1:<\/strong><\/p>\n\n<ul class=\"wp-block-list\">\n<li>Number of axles: 5<\/li>\n\n\n\n<li>Type of operation: Table C<\/li>\n\n\n\n<li>Cargo: Refrigerated<\/li>\n<\/ul>\n\n<p><strong>Truck 2:<\/strong><\/p>\n\n<ul class=\"wp-block-list\">\n<li>Number of axles: 6<\/li>\n\n\n\n<li>Type of operation: Table D<\/li>\n\n\n\n<li>Cargo: Solid Bulk<\/li>\n<\/ul>\n\n<p>In addition to freight, a flat rate of $120.00 and 5% tax will be added to the freight price.<\/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 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    \"operationType\": [\n        \"C\",\n        \"D\"\n    ],\n    \"goodsType\": [\n        \"FRIGORIFICADA_OU_AQUECIDA\",\n        \"GRANEL_SOLIDO\"\n    ],\n    \"axis\": [\n        5,\n        6\n    ],\n    \"roundTrip\": false,\n    \"backEmpty\": false,\n    \"distance\": 81,\n    \"otherCosts\": [\n        {\n            \"name\": \"Imposto\",\n            \"type\": \"PERCENT\",\n            \"value\": 5\n        },\n        {\n            \"name\": \"Taxa Fixa\",\n            \"type\": \"FIXED\",\n            \"value\": 120\n        }\n    ],\n    \"date\": \"2021-12-02\"\n}<\/pre>\n\n<p>When sending a request with multiple values, the API will consider all possible combinations to calculate the freight for the reported scenario. 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        \"D\": {\n            \"5\": {\n                \"GRANEL_SOLIDO\": {\n                    \"value\": 379.22,\n                    \"otherCosts\": {\n                        \"Taxa Fixa\": 120,\n                        \"Imposto\": 18.97\n                    }\n                },\n                \"FRIGORIFICADA_OU_AQUECIDA\": {\n                    \"value\": 459.30,\n                    \"otherCosts\": {\n                        \"Taxa Fixa\": 120,\n                        \"Imposto\": 22.97\n                    }\n                }\n            },\n            \"6\": {\n                \"GRANEL_SOLIDO\": {\n                    \"value\": 424.19,\n                    \"otherCosts\": {\n                        \"Taxa Fixa\": 120,\n                        \"Imposto\": 21.21\n                    }\n                },\n                \"FRIGORIFICADA_OU_AQUECIDA\": {\n                    \"value\": 511.11,\n                    \"otherCosts\": {\n                        \"Taxa Fixa\": 120,\n                        \"Imposto\": 25.56\n                    }\n                }\n            }\n        },\n        \"C\": {\n            \"5\": {\n                \"GRANEL_SOLIDO\": {\n                    \"value\": 409.15,\n                    \"otherCosts\": {\n                        \"Taxa Fixa\": 120,\n                        \"Imposto\": 20.46\n                    }\n                },\n                \"FRIGORIFICADA_OU_AQUECIDA\": {\n                    \"value\": 503.04,\n                    \"otherCosts\": {\n                        \"Taxa Fixa\": 120,\n                        \"Imposto\": 25.16\n                   }\n                }\n            },\n            \"6\": {\n                \"GRANEL_SOLIDO\": {\n                    \"value\": 454.12,\n                    \"otherCosts\": {\n                        \"Taxa Fixa\": 120,\n                        \"Imposto\": 22.71\n                    }\n                },\n                \"FRIGORIFICADA_OU_AQUECIDA\": {\n                   \"value\": 554.85,\n                    \"otherCosts\": {\n                        \"Taxa Fixa\": 120,\n                        \"Imposto\": 27.75\n                    }\n                }\n            }\n        }\n    },\n    \"minimumFreight\": 3694.98,\n    \"minimumFreightWithCosts\": 4839.77\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In this example, the haulier wants to obtain the minimum freight rates for a route between S\u00e3o Paulo and Santos (81 km) &#8211; one-way &#8211; which will be carried out by 2 trucks with the following logistical and contractual specifications: Truck 1: Truck 2: In addition to freight, a flat rate of $120.00 and 5% [&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-2762","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\/2762","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=2762"}],"version-history":[{"count":1,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2762\/revisions"}],"predecessor-version":[{"id":2763,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/posts\/2762\/revisions\/2763"}],"wp:attachment":[{"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/media?parent=2762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/categories?post=2762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developers.maplink.global\/en\/wp-json\/wp\/v2\/tags?post=2762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}