New freight to selected companies

Cre­at­ing new freight in Trans.eu Plat­form and send­ing it direct­ly to cho­sen car­ri­ers.

Url parameters and connection settings

  • URL: https://api.platform.trans.eu
  • End­point: /ex­t/freights-api/v1/freight-com­pa­nies
  • Method: POST

Headers:

  • Con­tent-type: application/json
  • Accept: application/json
  • Autho­riza­tion: Bear­er {access_token}
  • Api-key: {unique_app_api_key}

Authorization

Autho­riza­tion process is described here. Each API request must also con­sist of unique Api-key obtained dur­ing appli­ca­tion reg­is­tra­tion togeth­er with client_id and client_secret.

Freight publication and content

For infor­ma­tion about freight pay­load please refer to freight descrip­tion and freight schema.

Pub­li­ca­tion of freight to select­ed com­pa­nies requires at least one com­pa­ny id to be giv­en:

"carriers" : [ { "company_id" : 123 }]

Using this pub­li­ca­tion method it is pos­si­ble to use “is_first_buy” method, which allows to auto­mat­i­cal­ly accept first offer for giv­en price.

Also, please remem­ber to set pub­lish para­me­ter to true.

Json Exam­pleTypeIs requiredDescrip­tion
shipment_external_id2020/ABC/1/1StringNoExter­nal iden­ti­fi­ca­tion num­ber
external_source1_apiStringNoFreight source iden­ti­fi­er assigned to client_id pro­vid­ed by Trans.eu
capac­i­ty12FloatYesTotal freight capac­i­ty in tonnes. This val­ue is being val­i­dat­ed in com­par­i­son to the sum of all loads weight.
Range: 0,001 – 100000
is_first_buyYesBooleanNoDefines if price will be nego­ti­at­ed or only accept­ed by car­ri­er
pub­lishTrueBooleanYesDeter­mines if the freight is auto­mat­i­cal­ly pub­lished or only cre­at­ed
pay­mentObjectNoPay­ment con­di­tions for pub­li­ca­tion using groups or smart match
require­mentsObjectYesMain freight require­ments, includ­ing truck body and size adr class­es, ways of load­ing
car­ri­ers ArrayYesCon­tains a list of carrier’s com­pa­ny iden­ti­fiers (at least one of com­pa­ny id’s must be valid)
loadsArrayNoCol­lec­tion of freights’ loads. It is pos­si­ble to send emp­ty array of loads, nev­er­the­less an array has to be set
spotsObjectYesCol­lec­tion of freights’ spots — at least one load­ing and one unload­ing is required

Example request

Sam­ple Json for cre­at­ing new freight using required data only

{
  "capacity": 12,
  "requirements": {
    "is_ftl": false,
    "required_truck_bodies": [
      "curtainsider"
    ],
    "loads": []
  },
  "carriers": [
    {
      "company_id": 10
    }
  ],
  "spots": [
    {
      "spot_order": 1,
      "place": {
        "address": {
          "country": "PL",
          "postal_code": "12345",
          "locality": "Wroclaw"
        }
      },
      "operations": [
        {
          "timespans": {
            "begin": "2021-02-03T13:00:00+0100",
            "end": "2021-02-03T14:00:00+0100"
          },
          "type": "loading",
          "operation_order": 1
        }
      ]
    },
    {
      "spot_order": 2,
      "place": {
        "address": {
          "country": "DE",
          "postal_code": "09876",
          "locality": "Nürnberg"
        }
      },
      "operations": [
        {
          "timespans": {
            "begin": "2021-02-04T08:00:00+0100",
            "end": "2021-02-04T08:00:00+0100"
          },
          "type": "unloading",
          "operation_order": 1
        }
      ]
    }
  ],
  "publish": true
}

Response

{
  "accepted_price": null,
  "capacity": 12,
  "carrier": null,
  "id": 592018,
  "loading_meters": null,
  "loads": [],
  "publication_price": null,
  "reference_number": "FR/2021/02/03/X64K",
  "requirements": {
    "is_ftl": false,
    "other_requirements": [],
    "required_adr_classes": [],
    "required_truck_bodies": [
      "curtainsider"
    ],
    "required_ways_of_loading": [],
    "shipping_remarks": null,
    "temperature": {
      "max": null,
      "min": null
    },
    "vehicle_size": "any_size"
  },
  "shipment_external_id": null,
  "spots": [
    {
      "description": null,
      "name": null,
      "operations": [
        {
          "loads": [],
          "operation_order": 1,
          "timespans": {
            "begin": "2021-02-03T13:00:00+01:00",
            "end": "2021-02-03T14:00:00+01:00"
          },
          "type": "loading"
        }
      ],
      "place": {
        "address": {
          "country": "PL",
          "description": null,
          "locality": "Wroclaw",
          "number": null,
          "postal_code": "12345",
          "street": null
        },
        "coordinates": {
          "latitude": null,
          "longitude": null
        }
      },
      "spot_order": 1
    },
    {
      "description": null,
      "name": null,
      "operations": [
        {
          "loads": [],
          "operation_order": 1,
          "timespans": {
            "begin": "2021-02-04T08:00:00+01:00",
            "end": "2021-02-04T08:00:00+01:00"
          },
          "type": "unloading"
        }
      ],
      "place": {
        "address": {
          "country": "DE",
          "description": null,
          "locality": "Nürnberg",
          "number": null,
          "postal_code": "09876",
          "street": null
        },
        "coordinates": {
          "latitude": null,
          "longitude": null
        }
      },
      "spot_order": 2
    }
  ],
  "status": "new"
}