{"id":1468,"date":"2020-03-30T11:28:38","date_gmt":"2020-03-30T09:28:38","guid":{"rendered":"https:\/\/www.trans.eu\/api\/?p=1468"},"modified":"2025-12-29T11:14:16","modified_gmt":"2025-12-29T10:14:16","slug":"new-freight-using-smartmatch","status":"publish","type":"post","link":"https:\/\/www.trans.eu\/api\/freights\/new-freight-using-smartmatch\/","title":{"rendered":"New freight using smartmatch"},"content":{"rendered":"<p>Cre\u00adat\u00ading new freight in Trans.eu Plat\u00adform and send\u00ading it to car\u00adri\u00aders assigned using Smart\u00adMatch algo\u00adrithm.<\/p>\n<p><!--more--><\/p>\n<h2>Url parameters and connection settings<\/h2>\n<ul>\n<li><strong>URL:<\/strong> https:\/\/api.platform.trans.eu<\/li>\n<li><strong>End\u00adpoint:<\/strong> \/ex\u00adt\/freights-api\/v1\/freight-smart\u00admatch<\/li>\n<li><strong>Method:<\/strong> POST<\/li>\n<\/ul>\n<h2><strong>Headers:<\/strong><\/h2>\n<ul>\n<li>Con\u00adtent-type: application\/json<\/li>\n<li>Accept: application\/json<\/li>\n<li>Autho\u00adriza\u00adtion: Bear\u00ader {access_token}<\/li>\n<li>Api-key: {unique_ap\u00adp_api-key}<\/li>\n<\/ul>\n<h2>Authorization<\/h2>\n<p>Autho\u00adriza\u00adtion process <a href=\"https:\/\/www.trans.eu\/api\/general-information\/authorization-process\/\" target=\"_blank\" rel=\"noopener noreferrer\">is described here<\/a>. Each API request must also con\u00adsist of unique Api-key obtained dur\u00ading appli\u00adca\u00adtion reg\u00adis\u00adtra\u00adtion togeth\u00ader with client_id and client_secret.<\/p>\n<h2>Freight publication and content<\/h2>\n<p>For infor\u00adma\u00adtion about freight pay\u00adload please refer to <a href=\"https:\/\/www.trans.eu\/api\/freights\/freight-description\/\">freight descrip\u00adtion<\/a>&nbsp;and <a href=\"https:\/\/www.trans.eu\/api\/freights\/new-freight-to-direct-person\/\">freight schema<\/a>.<\/p>\n<p>Pub\u00adli\u00adca\u00adtion using Smart Match algo\u00adrithm does not require any addi\u00adtion\u00adal fields or set\u00adtings. Please remem\u00adber to set <strong>pub\u00adlish<\/strong> para\u00adme\u00adter to <strong>true<\/strong>.<\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>Json<\/strong><\/td>\n<td><strong>Exam\u00adple<\/strong><\/td>\n<td><strong>Type<\/strong><\/td>\n<td><strong>Is required<\/strong><\/td>\n<td><strong>Descrip\u00adtion<\/strong><\/td>\n<\/tr>\n<tr>\n<td>shipment_external_id<\/td>\n<td>2020\/ABC\/1\/1<\/td>\n<td>String<\/td>\n<td>No<\/td>\n<td>Exter\u00adnal iden\u00adti\u00adfi\u00adca\u00adtion num\u00adber<\/td>\n<\/tr>\n<tr>\n<td>external_source<\/td>\n<td>1_api<\/td>\n<td>String<\/td>\n<td>No<\/td>\n<td>Freight source iden\u00adti\u00adfi\u00ader assigned to client_id pro\u00advid\u00aded by Trans.eu<\/td>\n<\/tr>\n<tr>\n<td>capac\u00adi\u00adty<\/td>\n<td>12<\/td>\n<td>Float<\/td>\n<td>Yes<\/td>\n<td>Total freight capac\u00adi\u00adty in tonnes. This val\u00adue is being val\u00adi\u00addat\u00aded in com\u00adpar\u00adi\u00adson to the sum of all loads weight.<br>\nRange: 0,001 \u2013 100000<\/td>\n<\/tr>\n<tr>\n<td>pub\u00adlish<\/td>\n<td>True<\/td>\n<td>Boolean<\/td>\n<td>Yes<\/td>\n<td>Deter\u00admines if the freight is auto\u00admat\u00adi\u00adcal\u00adly pub\u00adlished or only cre\u00adat\u00aded<\/td>\n<\/tr>\n<tr>\n<td>pay\u00adment<\/td>\n<td style=\"text-align: center;\" colspan=\"2\">Object<\/td>\n<td>No<\/td>\n<td>Pay\u00adment con\u00addi\u00adtions for pub\u00adli\u00adca\u00adtion using groups or smart match<\/td>\n<\/tr>\n<tr>\n<td>require\u00adments<\/td>\n<td style=\"text-align: center;\" colspan=\"2\">Object<\/td>\n<td>Yes<\/td>\n<td>Main freight require\u00adments, includ\u00ading truck body and size adr class\u00ades, ways of load\u00ading<\/td>\n<\/tr>\n<tr>\n<td>loads<\/td>\n<td style=\"text-align: center;\" colspan=\"2\">Array<\/td>\n<td>Yes<\/td>\n<td>Col\u00adlec\u00adtion of freights\u2019 loads. It is pos\u00adsi\u00adble to send emp\u00adty array of loads, nev\u00ader\u00adthe\u00adless an array has to be set<\/td>\n<\/tr>\n<tr>\n<td>spots<\/td>\n<td style=\"text-align: center;\" colspan=\"2\">Object<\/td>\n<td>Yes<\/td>\n<td>Col\u00adlec\u00adtion of freights\u2019 spots \u2013 at least one load\u00ading and one unload\u00ading is required<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Example<\/h2>\n<p>Sam\u00adple Json for cre\u00adat\u00ading new freight using required data only<\/p>\n<pre class=\"wp-block-code\">{\n  \"capacity\": 12,\n  \"requirements\": {\n    \"is_ftl\": false,\n    \"required_truck_bodies\": [\n      \"curtainsider\"\n    ],\n    \"loads\": []\n  },\n  \"spots\": [\n    {\n      \"spot_order\": 1,\n      \"place\": {\n        \"address\": {\n          \"country\": \"PL\",\n          \"postal_code\": \"12345\",\n          \"locality\": \"Wroclaw\"\n        }\n      },\n      \"operations\": [\n        {\n          \"timespans\": {\n            \"begin\": \"2021-02-03T13:00:00+0100\",\n            \"end\": \"2021-02-03T14:00:00+0100\"\n          },\n          \"type\": \"loading\",\n          \"operation_order\": 1\n        }\n      ]\n    },\n    {\n      \"spot_order\": 2,\n      \"place\": {\n        \"address\": {\n          \"country\": \"DE\",\n          \"postal_code\": \"09876\",\n          \"locality\": \"N\u00fcrnberg\"\n        }\n      },\n      \"operations\": [\n        {\n          \"timespans\": {\n            \"begin\": \"2021-02-04T08:00:00+0100\",\n            \"end\": \"2021-02-04T08:00:00+0100\"\n          },\n          \"type\": \"unloading\",\n          \"operation_order\": 1\n        }\n      ]\n    }\n  ],\n  \"publish\": true\n}<\/pre>\n<h2>Response<\/h2>\n<pre class=\"wp-block-code\">{\n    \"accepted_price\": null,\n    \"capacity\": 12,\n    \"carrier\": null,\n    \"id\": 592018,\n    \"loading_meters\": null,\n    \"loads\": [],\n    \"publication_price\": null,\n    \"reference_number\": \"FR\/2021\/02\/03\/X64K\",\n    \"requirements\": {\n        \"is_ftl\": false,\n        \"other_requirements\": [],\n        \"required_adr_classes\": [],\n        \"required_truck_bodies\": [\n            \"curtainsider\"\n        ],\n        \"required_ways_of_loading\": [],\n        \"shipping_remarks\": null,\n        \"temperature\": {\n            \"max\": null,\n            \"min\": null\n        },\n        \"vehicle_size\": \"any_size\"\n    },\n    \"shipment_external_id\": null,\n    \"spots\": [\n        {\n            \"description\": null,\n            \"name\": null,\n            \"operations\": [\n                {\n                    \"loads\": [],\n                    \"operation_order\": 1,\n                    \"timespans\": {\n                        \"begin\": \"2021-02-03T13:00:00+01:00\",\n                        \"end\": \"2021-02-03T14:00:00+01:00\"\n                    },\n                    \"type\": \"loading\"\n                }\n            ],\n            \"place\": {\n                \"address\": {\n                    \"country\": \"PL\",\n                    \"description\": null,\n                    \"locality\": \"Wroclaw\",\n                    \"number\": null,\n                    \"postal_code\": \"12345\",\n                    \"street\": null\n                },\n                \"coordinates\": {\n                    \"latitude\": null,\n                    \"longitude\": null\n                }\n            },\n            \"spot_order\": 1\n        },\n        {\n            \"description\": null,\n            \"name\": null,\n            \"operations\": [\n                {\n                    \"loads\": [],\n                    \"operation_order\": 1,\n                    \"timespans\": {\n                        \"begin\": \"2021-02-04T08:00:00+01:00\",\n                        \"end\": \"2021-02-04T08:00:00+01:00\"\n                    },\n                    \"type\": \"unloading\"\n                }\n            ],\n            \"place\": {\n                \"address\": {\n                    \"country\": \"DE\",\n                    \"description\": null,\n                    \"locality\": \"N\u00fcrnberg\",\n                    \"number\": null,\n                    \"postal_code\": \"09876\",\n                    \"street\": null\n                },\n                \"coordinates\": {\n                    \"latitude\": null,\n                    \"longitude\": null\n                }\n            },\n            \"spot_order\": 2\n        }\n    ],\n    \"status\": \"new\"\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p class=\"dont-break-out\">Cre\u00adat\u00ading new freight in Trans.eu Plat\u00adform and send\u00ading it to car\u00adri\u00aders assigned using Smart\u00adMatch algo\u00adrithm.<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"wp_typography_post_enhancements_disabled":false,"footnotes":""},"categories":[42],"tags":[],"class_list":["post-1468","post","type-post","status-publish","format-standard","hentry","category-freights"],"acf":[],"aioseo_notices":[],"lang":"en","translations":{"en":1468},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/posts\/1468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/comments?post=1468"}],"version-history":[{"count":2,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/posts\/1468\/revisions"}],"predecessor-version":[{"id":5564,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/posts\/1468\/revisions\/5564"}],"wp:attachment":[{"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/media?parent=1468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/categories?post=1468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/tags?post=1468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}