Allows to update content of an existing freight by given id. Updates are possible only to freights that have not yet been published.
If a freight has been added using automation rules, we cannot republish that freight by updating it using publish = true value.
Url parameters and connection settings
- HTTP Method: PUT
- URL: https://api.platform.trans.eu
- Endpoint for freight added with the automation rules: /ext/freights-api/v1/freight-auto/{freightId}
- Endpoint for freight added to selected companies: /ext/freights-api/v1/freight-companies/{freightId}
- Endpoint for freight added to corporate exchange: /ext/freights-api/v1/freight-corporate/{freightId}
- Endpoint for freight added to freight exchange: /ext/freights-api/v1/freight-exchange/{freightId}
Headers
- Accept: application/json
- Content-type: application/json
- Authorization: Bearer {access_token}
- Api-key: {Unique api key}
Authorization
Authorization process is described here.
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 updating 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 properly given 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"
}
Important! It is allowed to access freights created by employees of authorized user’s company account only.