Creating new freight in Trans.eu Platform

Basic information

The freight is created as “sent freight” and immediately visible in appropriate module.

Using publication types the freight might be just added or automatically published using automation rules created within Trans.eu Platform.

Technical aspects

Url parameters and connection settings

  • URL: https://api.platform.trans.eu
  • Endpoint: /ext/freights-api/freights
  • Method: POST
  • Authorization: Bearer {access_token}
  • Content-type: application/json

Authorization

Authorization process is described here.

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

Freight

Allowed fields of a freight are described in freight description.

Field Type Example Description
external_shipment_id string 9876-aaa-123 Freight identification number from external system
external_source string 1_system Freight source identifier
capacity int or float 12 Total freight capacity in tonnes. This value is being validated in comparison to the sum of all loads.
Range: 0,001 – 100000 Required
loading_meters int or float 8 Total freight loading meters
multistop int 0 or 1 Freight with more than two stops needs to be declared as multistop
requirements Object Collection of freight general requirements
requirements.is_ftl boolean true Determines if freight is a full truck load or less than truckload. Required
requirements.required_truck_bodies array [“mega”,”tent”] Array of available truck body types
publish string auto Determines if freight is automatically published using rules set on Platform’s user interface. If left empty or null, freight will be created and not published
publication_price Object Price given by user during freight creation
publication_price.currency string eur Price currency
publication_price.value string 1000 Price value
loads Object Collection of freights’ loads. It is possible to send empty array of loads, nevertheless an array has to be set.
loads.id string 123456 Load given id
loads.name string First load Name of a load
loads.type_of_load string palette Name of supported type of load
loads.weight int or float 7 The weight of a given load in tonnes
loads.height int or float 2 The height of a given load in meters
loads.width int or float 2 The width of a given load in meters
loads.length int or float 6 The length of a given load in meters
loads.volume int or float 5 The volume of the load in cubic meters
loads.amount int 1 The amount of loads with given parameters.
loads.description string Load description Description of given load
loads.is_stackable boolean true Specifies whether the type of load allows stacking
loads.is_exchangeable boolean false Determines if there are palettes available for exchange at unloading place
spots.name string Example name Name of the loading or unloading place
spots.description string Example description Description of the loading or unloading place
spots.spot_order int 1 Information about the order of operations at this location
spots.place Object Information related to single place on freight’s route
spots.place.address Object Address data
spots.place.address.country string DE Country using ISO values Required
spots.place.address.postal_code string 52-200 Postal code Required
spots.place.address.locality string Paris City name Required
spots.place.address.street string Champs elysees Street name
spots.place.address.number string 44 Number
spots.place.coordinates Object Longitude and latitude for selected point
spots.place.coordinates.latitude float 51.8338 Latitude of the point along the freight route
spots.place.coordinates.longitude float 16.5792 Longitude of the point along the freight route
spots.operations Object Array of operations to be completed in given spot
spots.operations.operation_order int 1 The order of loading and unloading operations at a given spot.
spots.operations.loads string 123456 Reference to a previously defined load that is to be partially or completely unloaded or loaded at a given location.
spots.operations.timespans Object Timespan for selected operation
spots.operations.timespans.begin timestamp 2018-07-18T14:30:00+0200 Beginning of time slot for loading or unloading operation Required
spots.operations.timespans.end timestamp 2018-07-18T14:30:00+0200 End of time slot for loading or unloading operation Required
spots.operations.type string loading Could be either loading or unloading, at least one of each is required Required

Example #1

Sample Json for creating new freight using required data only

{
  "publication_price": {
    "value": 123,
    "currency": "EUR"
  },
  "capacity": 12,
  "requirements": {
    "is_ftl": false,
    "required_truck_bodies": [
      "9_curtainsider"
    ]
  },
  "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": []
        }
      ]
    },
    {
      "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,
  "carier": {
  },
  "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
    }
  ]
}