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/v1/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 publication and content

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

Publication using automation rules does not require any additional fields or settings. Please remember to set publish parameter to true. There is no automation rules API. The configuration process must be done manually on the Trans.eu Platform.

Freight payload for publication using automation rules does not contain price, it is being defined while setting up the automation rule on Trans.eu Platform.

Example

Sample Json for creating new freight using required data only

{
  "capacity": 12,
  "requirements": {
    "is_ftl": false,
    "required_truck_bodies": [
      "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
    }
  ]
}