Update existing freight

Allows to update con­tent of an exist­ing freight by giv­en id. Updates are pos­si­ble only to freights that have not yet been pub­lished.

If a freight has been added using automa­tion rules, we can­not repub­lish that freight by updat­ing it using pub­lish = true val­ue.

Url parameters and connection settings

  • HTTP Method: PUT
  • URL: https://api.platform.trans.eu
  • End­point for freight added with the automa­tion rules: /ext/freights-api/v1/freight-auto/{freightId}
  • End­point for freight added to select­ed com­pa­nies: /ext/freights-api/v1/freight-companies/{freightId}
  • End­point for freight added to cor­po­rate exchange: /ext/freights-api/v1/freight-corporate/{freightId}
  • End­point for freight added to freight exchange: /ext/freights-api/v1/freight-exchange/{freightId}

Headers

  • Accept: application/json
  • Con­tent-type: application/json
  • Autho­riza­tion: Bear­er {access_token}
  • Api-key: {Unique api key}

Authorization

Autho­riza­tion process is described here.

Limitations

Terms and con­di­tions relat­ed to updat­ing exist­ing freight:

  • Valid freight id has to be giv­en
  • It is only pos­si­ble to update own cre­at­ed freights
  • Updat­ing exist­ing freights over­writes com­plete­ly freight. If any val­ue is not set and allowed as null, it will be con­sid­ered as null val­ue and over­writ­ten.

Sample request

Sam­ple Json for updat­ing freight using required data only.

{
  "publish": true,
  "capacity": 12,
  "payment": {
    "price": {
      "value": 110,
      "currency": "eur",
      "period": {
        "payment": "deferred",
        "days": 5
      }
    }
  },
  "requirements": {
    "is_ftl": false,
    "required_truck_bodies": [
      "curtainsider"
    ],
    "loads": []
  },
  "spots": [
    {
      "spot_order": 1,
      "place": {
        "address": {
          "country": "pl",
          "postal_code": "12345",
          "locality": "Wroclaw"
        }
      },
      "operations": [
        {
          "timespans": {
            "begin": "{{loading_begin}}",
            "end": "{{loading_end}}"
          },
          "type": "loading",
          "operation_order": 1,
          "loads": []
        }
      ]
    },
    {
      "spot_order": 2,
      "place": {
        "address": {
          "country": "de",
          "postal_code": "09876",
          "locality": "Nürnberg"
        }
      },
      "operations": [
        {
          "timespans": {
            "begin": "{{unloading_begin}}",
            "end": "{{unloading_end}}"
          },
          "type": "unloading",
          "operation_order": 1,
          "loads": []
        }
      ]
    }
  ]
}

Response

Response to prop­er­ly giv­en freight id.

{
    "accepted_price": null,
    "capacity": 12,
    "carrier": null,
    "id": 606680,
    "loading_meters": null,
    "loads": [],
    "publication_price": null,
    "reference_number": "FR/2021/02/16/INPO",
    "requirements": {
        "is_ftl": false,
        "other_requirements": [],
        "required_adr_classes": [],
        "required_truck_bodies": [
            "curtainsider"
        ],
        "required_ways_of_loading": [],
        "shipping_remarks": null,
        "temperature": {
            "max": null,
            "min": null
        },
        "vehicle_size": "any_size"
    },
    "shipment_external_id": null,
    "spots": [
        {
            "description": null,
            "name": null,
            "operations": [
                {
                    "loads": [],
                    "operation_order": 1,
                    "timespans": {
                        "begin": "2021-02-19T12:56:59+01:00",
                        "end": "2021-02-19T14:56:59+01:00"
                    },
                    "type": "loading"
                }
            ],
            "place": {
                "address": {
                    "country": "pl",
                    "description": null,
                    "locality": "Wroclaw",
                    "number": null,
                    "postal_code": "12345",
                    "street": null
                },
                "coordinates": {
                    "latitude": null,
                    "longitude": null
                }
            },
            "spot_order": 1
        },
        {
            "description": null,
            "name": null,
            "operations": [
                {
                    "loads": [],
                    "operation_order": 1,
                    "timespans": {
                        "begin": "2021-02-22T12:56:59+01:00",
                        "end": "2021-02-22T14:56:59+01:00"
                    },
                    "type": "unloading"
                }
            ],
            "place": {
                "address": {
                    "country": "de",
                    "description": null,
                    "locality": "Nürnberg",
                    "number": null,
                    "postal_code": "09876",
                    "street": null
                },
                "coordinates": {
                    "latitude": null,
                    "longitude": null
                }
            },
            "spot_order": 2
        }
    ],
    "status": "new"
}

Impor­tant! It is allowed to access freights cre­at­ed by employ­ees of autho­rized user’s com­pa­ny account only.