Creating new freight in Trans.eu Platform using previously created automation rules. The freight is created as “sent freight” and immediately visible in appropriate module.

Url parameters and connection settings

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

Headers:

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

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 for creating a freight, for more information please refer to freight description.

Field Type Example Is required
external_shipment_id string 9876-aaa-123 No
external_source string 3_api_trans No
capacity int or float 12 Required
loading_meters int or float 8  No
multistop int 0 or 1 Required
requirements Object Required
requirements.is_ftl boolean true Required
requirements.required_truck_bodies array [“mega”,”tent”] Required
publish boolean true Yes
publication_price Object No
publication_price.currency string eur No
publication_price.value string 1000 No
loads Object Required
loads.id string 123456 No
loads.name string First load No
loads.type_of_load string palette No
loads.weight int or float 7 No
loads.height int or float 2 No
loads.width int or float 2 No
loads.length int or float 6 No
loads.volume int or float 5 No
loads.amount int 1 No
loads.description string Load description No
loads.is_stackable boolean true No
loads.is_exchangeable boolean false No
spots.name string Example name No
spots.description string Example description No
spots.spot_order int 1 No
spots.place Object No
spots.place.address Object Required
spots.place.address.country string DE Required
spots.place.address.postal_code string 52-200 Required
spots.place.address.locality string Paris Required
spots.place.address.street string Champs elysees No
spots.place.address.number string 44 No
spots.place.coordinates Object No
spots.place.coordinates.latitude float 51.8338 No
spots.place.coordinates.longitude float 16.5792 No
spots.operations Object Required
spots.operations.operation_order int 1 Required
spots.operations.loads string 123456 Required
spots.operations.timespans Required
spots.operations.timespans.begin timestamp 2018-07-18T14:30:00+0200 Required
spots.operations.timespans.end timestamp 2018-07-18T14:30:00+0200 Required
spots.operations.type string loading 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": [{
            "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,
  "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
    }
  ]
}