Creating new freight in Trans.eu Platform and sending it directly to chosen carriers.

Url parameters and connection settings

  • URL: https://api.platform.trans.eu
  • Endpoint: /ext/freights-api/v1/freight-companies
  • Method: POST

Headers:

  • Content-type: application/json
  • Accept: application/json
  • Authorization: Bearer {access_token}
  • Api-key: {unique_app_api_key}

Authorization

Authorization process is described here. Each API request must also consist of unique Api-key obtained during application registration together with client_id and client_secret.

For accessing freights API no additional scopes are set, therefore the scope parameter can be left empty.

Freight publication and content

For information about freight payload please refer to freight description and freight schema.

Publication of freight to selected companies requires at least one company id to be given:

“carriers” : [ { “company_id” : 123 }]

Using this publication method it is possible to use “is_first_buy” method, which allows to automatically accept first offer for given price.

Also, please remember to set publish parameter to true.

Example

Sample Json for creating new freight using required data only

{
  "payment": {
    "price": {
      "value": 123,
      "currency": "EUR"
   }
  },
  "capacity": 12,
  "is_first_buy": true,
  "requirements": {
    "is_ftl": false,
    "required_truck_bodies": [
      "curtainsider"
    ]
  },
  "carriers" : [
    { "company_id" : 123 },
    { "company_id" : 345 }
  ],
  "spots": [
    {
      "spot_order": 1,
      "place": {
        "address": {
          "country": "pl",
          "postal_code": "12345",
          "locality": "Wroclaw"
        },
        "coordinates": {
          "latitude": 49.8056,
          "longitude": 12.1881
        }
      },
      "operations": [
        {
          "timespans": {
            "begin": "2020-01-28T17:00:00+0100",
            "end": "2020-01-28T17:00:00+0100"
          },
          "type": "loading",
          "operation_order": 1,
          "loads": [{
            "id": "abcd-123",
             "weight": 10
             }]
        }
      ]
    },
    {
      "spot_order": 2,
      "place": {
        "address": {
          "country": "de",
          "postal_code": "09876",
          "locality": "Nürnberg"
        },
        "coordinates": {
          "latitude": 49.4608,
          "longitude": 11.0244
        }
      },
      "operations": [
        {
          "timespans": {
            "begin": "2020-01-29T08:00:00+0100",
            "end": "2020-01-29T08:00:00+0100"
          },
          "type": "unloading",
          "operation_order": 1,
          "loads": []
        }
      ]
    }
  ],
  "loads": [],
  "publish": "auto"
}

Response

{
  "accepted_price": null,
  "capacity": 12,
  "carrier": {
  },
  "id": 1966666,
  "loading_meters": null,
  "loads": [],
  "publication_price": null,
  "requirements": {
    "is_ftl": false,
    "required_truck_bodies": [
      "curtainsider"
    ]
  },
  "spots": [
    {
      "description": null,
      "name": null,
      "operations": [
        {
          "loads": [],
          "operation_order": 1,
          "timespans": {
            "begin": "2020-02-18T17:00:00+01:00",
            "end": "2020-02-18T17:00:00+01:00"
          },
          "type": "loading"
        }
      ],
      "place": {
        "address": {
          "country": "de",
          "description": null,
          "locality": "Windischeschenbach",
          "number": null,
          "postal_code": "92670",
          "street": null
        }
      },
      "spot_order": 1
    },
    {
      "description": null,
      "name": null,
      "operations": [
        {
          "loads": [],
          "operation_order": 1,
          "timespans": {
            "begin": "2020-02-19T08:00:00+01:00",
            "end": "2020-02-19T08:00:00+01:00"
          },
          "type": "unloading"
        }
      ],
      "place": {
        "address": {
          "country": "pl",
          "description": null,
          "locality": "Nürnberg",
          "number": null,
          "postal_code": "90429",
          "street": null
        }
      },
      "spot_order": 2
    }
  ]
}