Allows to update content of an existing freight by given id. Updates are possible only to freights that have not yet been published.

Query

Request address and parameters.

  • HTTP Method: PUT
  • URL: https://api.platform.trans.eu
  • Endpoint: /ext/freights-api/v1/freights/{freightId}

Headers

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

Authorization

Authorization process is described here.

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

Limitations

Terms and conditions related to updating existing freight:

  • Valid freight id has to be given
  • It is only possible to update own created freights
  • Updating existing freights overwrites completely freight. If any value is not set and allowed as null, it will be considered as null value and overwritten.

Sample request

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": [
      "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

Response to properly given freight id.

{
  "capacity": 20,
  "loading_meters": 2,
  "status" : "search_for_carriers",
  "price" : 123.22,
  "requirements": {
    "is_ftl": true,
    "required_truck_bodies": [
      "truck"
    ]
  },
  "carrier" : {
      "id" : "123",  
      "name" : "Example company name",
      "vat" : "PL123456789",
      "address" : {
          "country" : "pl",
          "locality" : "Sopot",
          "postal_code" : "12-345",
          "street" : "Example street",
          "number" : "13a"
      }
},
  "loads": [
      "id": 279606,
      "name": "Example load no 1",
      "type_of_load": "palette",
      "weight": 2,
      "height": 1,
      "width": 2,
      "length": 9,
      "volume": 20,
      "amount": 3,
      "description": null,
      "load_id": null,
      "is_stackable": false,
      "is_exchangeable": false
   }
],
  "spots": [
    {
      "name": "string",
      "description": "string",
      "spot_order": 0,
      "place": {
        "address": {
          "country": "pl",
          "street": "Racławicka",
          "number": "2-4",
          "locality": "Wrocław",
          "postal_code": "53-146",
          "description": "Trans.eu office"
        },
        "coordinates": {
          "latitude": 51.085615,
          "longitude": 17.0105
        }
      },
      "operations": {
        "operation_order": 0,
        "loads": [],
        "timespans": {
          "end": "2018-07-18T14:30:00+0200",
          "begin": "2018-07-20T14:30:00+0200"
        },
        "type": "loading"
      }
    },
    {
      "name": "Second spot name",
      "description": "Second spot description",
      "spot_order": 0,
      "place": {
        "address": {
          "country": "lt",
          "street": "Example street",
          "number": "5",
          "locality": "Riga",
          "postal_code": "1016",
          "description": "Trans.eu office"
        },
        "coordinates": {
          "latitude": 52.085615,
          "longitude": 19.0105
        }
      },
      "operations": {
        "operation_order": 0,
        "loads": [{
            "id" : 123456,
            "weight" : 12
        ],
        "timespans": {
          "end": "2018-07-18T14:30:00+0200",
          "begin": "2018-07-20T14:30:00+0200"
        },
        "type": "unloading"
      }
    },
  ]
}

Important! It is allowed to access freights created by employees of authorized user’s company account only.