{"id":1999,"date":"2020-06-22T11:38:43","date_gmt":"2020-06-22T09:38:43","guid":{"rendered":"https:\/\/www.trans.eu\/api\/?p=1999"},"modified":"2025-12-29T11:03:59","modified_gmt":"2025-12-29T10:03:59","slug":"search-for-carriers-with-user-defined-pubication","status":"publish","type":"post","link":"https:\/\/www.trans.eu\/api\/use-cases\/integration-scenarios\/search-for-carriers-with-user-defined-pubication\/","title":{"rendered":"Search for carriers with user defined publication"},"content":{"rendered":"\n<p>Descrip\u00adtion of adding a freight to com\u00adpa\u00adnies cho\u00adsen by rec\u00adom\u00admen\u00adda\u00adtion algo\u00adrithm, with declar\u00ading the freight price.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Scenario<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>car\u00adri\u00ader is yet to be deter\u00admined<\/li>\n\n\n\n<li>price was not giv\u00aden<\/li>\n\n\n\n<li>car\u00adri\u00ader is using Trans.eu Plat\u00adform only, with no addi\u00adtion\u00adal freight man\u00adage\u00adment soft\u00adware involved<\/li>\n\n\n\n<li>both freight for\u00adwarder and car\u00adri\u00aders have exist\u00ading and valid Trans.eu account<\/li>\n\n\n\n<li>car\u00adri\u00ader has to meet spec\u00adi\u00adfied cri\u00adte\u00adria<\/li>\n\n\n\n<li>the car\u00adri\u00ader does not belong to the group of con\u00adtrac\u00adtors<\/li>\n\n\n\n<li>there are cor\u00adre\u00adspond\u00ading automa\u00adtion rules set on Trans.eu Plat\u00adform<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Authorize access<\/h2>\n\n\n\n<p>Before it is pos\u00adsi\u00adble to send any request, user needs to <a href=\"https:\/\/www.trans.eu\/api\/general-information\/authorization-process\/\" title>autho\u00adrize access<\/a>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>client app was reg\u00adis\u00adtered using reg\u00adis\u00adtra\u00adtion form<\/li>\n\n\n\n<li>exter\u00adnal app was grant\u00aded api keys (client_id and client_secret)<\/li>\n\n\n\n<li>autho\u00adriza\u00adtion process has been imple\u00adment\u00aded in exter\u00adnal app<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Create new freight<\/h2>\n\n\n\n<p>In order to send freight pro\u00adpos\u00adals to car\u00adri\u00aders tai\u00adlored to its cri\u00adte\u00adria, the <a href=\"https:\/\/www.trans.eu\/api\/use-cases\/search-for-carrier-using-recommended-companies\/\" target=\"_blank\" rel=\"noopener noreferrer\">pub\u00adli\u00adca\u00adtion method using the smart\u00admatch algo\u00adrithm<\/a> must be used.<\/p>\n\n\n\n<p>Each freight must con\u00adsist of:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>load\u00ading loca\u00adtion and time<\/li>\n\n\n\n<li>unload\u00ading loca\u00adtion and time<\/li>\n\n\n\n<li>required truck body type<\/li>\n\n\n\n<li>sum\u00adma\u00adry of freight\u2019s loads weight<\/li>\n\n\n\n<li>ftl\/ltl para\u00adme\u00adter<\/li>\n\n\n\n<li>cur\u00adren\u00adcy<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Diagram<\/strong><\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"367\" src=\"https:\/\/www.trans.eu\/api\/wp-content\/uploads\/User-defined-publication-1024x367.png\" alt class=\"wp-image-2003\" srcset=\"https:\/\/www.trans.eu\/api\/wp-content\/uploads\/User-defined-publication-1024x367.png 1024w, https:\/\/www.trans.eu\/api\/wp-content\/uploads\/User-defined-publication-300x108.png 300w, https:\/\/www.trans.eu\/api\/wp-content\/uploads\/User-defined-publication-768x275.png 768w, https:\/\/www.trans.eu\/api\/wp-content\/uploads\/User-defined-publication.png 1146w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\"><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>Endpoint:<\/strong><\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>POST https:\/\/api.platform.trans.eu\/ext\/freights-api\/v1\/freight-auto<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Request example:&nbsp;<\/strong><\/h2>\n\n\n\n<p>Exam\u00adple of trans\u00adport order post\u00ading request:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>{\n  \"payment\": {\n    \"price\": {\n      \"value\": 123,\n      \"currency\": \"eur\"\n    }\n  },\n  \"capacity\": 12,\n  \"exchange_recipients\": \"carriers\",\n  \"requirements\": {\n    \"is_ftl\": false,\n    \"required_truck_bodies\": [\n      \"cooler\"\n    ]\n  },\n  \"spots\": [\n    {\n      \"spot_order\": 1,\n      \"place\": {\n        \"address\": {\n          \"country\": \"fr\",\n          \"postal_code\": \"11111\",\n          \"locality\": \"null\"\n        },\n        \"coordinates\": {\n          \"latitude\": 49.8056,\n          \"longitude\": 12.1881\n        }\n      },\n      \"operations\": [\n        {\n          \"timespans\": {\n            \"begin\": \"2020-06-25T09:00:00+01:00\",\n            \"end\": \"2020-06-25T09:00:00+01:00\"\n          },\n          \"type\": \"loading\",\n          \"operation_order\": 1,\n          \"loads\": []\n        }\n      ]\n    },\n    {\n      \"spot_order\": 2,\n      \"place\": {\n        \"address\": {\n          \"country\": \"lt\",\n          \"postal_code\": \"22222\",\n          \"locality\": \"City\"\n        },\n        \"coordinates\": {\n          \"latitude\": null,\n          \"longitude\": null\n        }\n      },\n      \"operations\": [\n        {\n          \"timespans\": {\n            \"begin\": \"2020-06-26T09:00:00+01:00\",\n            \"end\": \"2020-06-26T09:00:00+01:00\"\n          },\n          \"type\": \"unloading\",\n          \"operation_order\": 1,\n          \"loads\": []\n        }\n      ]\n    }\n  ],\n  \"loads\": [\n    {\n      \"name\": \"example\",\n      \"description\": \"Example description\",\n      \"load_id\": \"1\",\n      \"type_of_load\": \"palette\",\n      \"weight\": 1,\n      \"height\": 1,\n      \"length\": 1,\n      \"volume\": 1,\n      \"amount\": 1,\n      \"is_stackable\": false,\n      \"is_exchangeable\": false\n    }\n  ],\n  \"publish\": true\n}<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Response example:<\/strong><\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>{\n  \"payment\": {\n    \"price\": {\n      \"value\": null,\n      \"currency\": \"eur\"\n    }\n  },\n  \"capacity\": 12,\n  \"exchange_recipients\": \"carriers\",\n  \"requirements\": {\n    \"is_ftl\": false,\n    \"required_truck_bodies\": [\n      \"cooler\"\n    ]\n  },\n  \"spots\": [\n    {\n      \"spot_order\": 1,\n      \"place\": {\n        \"address\": {\n          \"country\": \"fr\",\n          \"postal_code\": \"11111\",\n          \"locality\": \"null\"\n        },\n        \"coordinates\": {\n          \"latitude\": 49.8056,\n          \"longitude\": 12.1881\n        }\n      },\n      \"operations\": [\n        {\n          \"timespans\": {\n            \"begin\": \"2020-06-25T09:00:00+01:00\",\n            \"end\": \"2020-06-25T09:00:00+01:00\"\n          },\n          \"type\": \"loading\",\n          \"operation_order\": 1,\n          \"loads\": []\n        }\n      ]\n    },\n    {\n      \"spot_order\": 2,\n      \"place\": {\n        \"address\": {\n          \"country\": \"lt\",\n          \"postal_code\": \"22222\",\n          \"locality\": \"City\"\n        },\n        \"coordinates\": {\n          \"latitude\": null,\n          \"longitude\": null\n        }\n      },\n      \"operations\": [\n        {\n          \"timespans\": {\n            \"begin\": \"2020-06-26T09:00:00+01:00\",\n            \"end\": \"2020-06-26T09:00:00+01:00\"\n          },\n          \"type\": \"unloading\",\n          \"operation_order\": 1,\n          \"loads\": []\n        }\n      ]\n    }\n  ],\n  \"loads\": [\n    {\n      \"name\": \"example\",\n      \"description\": \"Example description\",\n      \"load_id\": \"1\",\n      \"type_of_load\": \"palette\",\n      \"weight\": 1,\n      \"height\": 1,\n      \"length\": 1,\n      \"volume\": 1,\n      \"amount\": 1,\n      \"is_stackable\": false,\n      \"is_exchangeable\": false\n    }\n  ],\n  \"publish\": true\n}<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Receive offers<\/h2>\n\n\n\n<p>Each response for freight pub\u00adli\u00adca\u00adtion can e accessed using APi. To find out which car\u00adri\u00aders respond\u00aded send the request below:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>GET https:\/\/api.platform.trans.eu\/ext\/freights\/v1\/{freight-id}\/offers<\/code><\/pre><\/div>\n\n\n\n<p>If there is no response, you will receive emp\u00adty array.<\/p>\n\n\n\n<p>If respons\u00ades have been sent, there will be array, which con\u00adsists of each response:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Negotiation<\/h2>\n\n\n\n<p>It pos\u00adsi\u00adble to accept, reject or nego\u00adti\u00adate received price con\u00addi\u00adtions<\/p>\n\n\n\n<p>Accept:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>https:\/\/api.platform.trans.eu\/ext\/freights\/v1\/{offer-id}\/accept<\/code><\/pre><\/div>\n\n\n\n<p>Reject:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>https:\/\/api.platform.trans.eu\/ext\/freights\/v1\/{offer-id}\/reject<\/code><\/pre><\/div>\n\n\n\n<p>Nego\u00adti\u00adate:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>https:\/\/api.platform.trans.eu\/ext\/freights\/v1\/{offer-id}\/negotiate<\/code><\/pre><\/div>\n\n\n\n<p>Pay\u00adload:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>{\n  \"payment\": {\n    \"price\": {\n      \"value\": 100,\n      \"currency\": \"pln\"\n    }\n  },\n  \"requirements\": \"requirements description\",\n  \"version\": 3,\n  \"carrier_decision_date\": \"2020-05-20T12:00:00+02:00\"\n}<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Accepted freight<\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>{\n  \"payment\": {\n    \"price\": {\n      \"value\": 100,\n      \"currency\": \"eur\"\n    }\n  },\n  \"capacity\": 12,\n  \"requirements\": {\n    \"is_ftl\": false,\n    \"required_truck_bodies\": [\n      \"cooler\"\n    ]\n  },\n  \"spots\": [\n    {\n      \"spot_order\": 1,\n      \"place\": {\n        \"address\": {\n          \"country\": \"fr\",\n          \"postal_code\": \"11111\",\n          \"locality\": \"null\"\n        },\n        \"coordinates\": {\n          \"latitude\": 49.8056,\n          \"longitude\": 12.1881\n        }\n      },\n      \"operations\": [\n        {\n          \"timespans\": {\n            \"begin\": \"2020-06-25T09:00:00+01:00\",\n            \"end\": \"2020-06-25T09:00:00+01:00\"\n          },\n          \"type\": \"loading\",\n          \"operation_order\": 1,\n          \"loads\": []\n        }\n      ]\n    },\n    {\n      \"spot_order\": 2,\n      \"place\": {\n        \"address\": {\n          \"country\": \"lt\",\n          \"postal_code\": \"22222\",\n          \"locality\": \"City\"\n        },\n        \"coordinates\": {\n          \"latitude\": null,\n          \"longitude\": null\n        }\n      },\n      \"operations\": [\n        {\n          \"timespans\": {\n            \"begin\": \"2020-06-26T09:00:00+01:00\",\n            \"end\": \"2020-06-26T09:00:00+01:00\"\n          },\n          \"type\": \"unloading\",\n          \"operation_order\": 1,\n          \"loads\": []\n        }\n      ]\n    }\n  ],\n  \"loads\": [\n    {\n      \"name\": \"example\",\n      \"description\": \"Example description\",\n      \"load_id\": \"1\",\n      \"type_of_load\": \"palette\",\n      \"weight\": 1,\n      \"height\": 1,\n      \"length\": 1,\n      \"volume\": 1,\n      \"amount\": 1,\n      \"is_stackable\": false,\n      \"is_exchangeable\": false\n    }\n  ],\n  \"publish\": true\n}<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p class=\"dont-break-out\">Descrip\u00adtion of adding a freight to com\u00adpa\u00adnies cho\u00adsen by rec\u00adom\u00admen\u00adda\u00adtion algo\u00adrithm, with declar\u00ading the freight price.<\/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":[58],"tags":[],"class_list":["post-1999","post","type-post","status-publish","format-standard","hentry","category-integration-scenarios"],"acf":[],"aioseo_notices":[],"lang":"en","translations":{"en":1999},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/posts\/1999","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=1999"}],"version-history":[{"count":2,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/posts\/1999\/revisions"}],"predecessor-version":[{"id":5536,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/posts\/1999\/revisions\/5536"}],"wp:attachment":[{"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/media?parent=1999"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/categories?post=1999"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/tags?post=1999"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}