Creating new freight in Trans.eu Platform and sending it directly to chosen carriers.
Url parameters and connection settings
- URL: https://api.platform.trans.eu
- Endpoint: /ext/freights-api/v1/freight-companies
- Method: POST
Headers:
- Content-type: application/json
- Accept: application/json
- Authorization: Bearer {access_token}
- Api-key: {unique_app_api_key}
Authorization
Authorization process is described here. Each API request must also consist of unique Api-key obtained during application registration together with client_id and client_secret.
Freight publication and content
For information about freight payload please refer to freight description and freight schema.
Publication of freight to selected companies requires at least one company id to be given:
"carriers" : [ { "company_id" : 123 }]
Using this publication method it is possible to use “is_first_buy” method, which allows to automatically accept first offer for given price.
Also, please remember to set publish parameter to true.
Json | Example | Type | Is required | Description |
shipment_external_id | 2020/ABC/1/1 | String | No | External identification number |
external_source | 1_api | String | No | Freight source identifier assigned to client_id provided by Trans.eu |
capacity | 12 | Float | Yes | Total freight capacity in tonnes. This value is being validated in comparison to the sum of all loads weight. Range: 0,001 – 100000 |
is_first_buy | Yes | Boolean | No | Defines if price will be negotiated or only accepted by carrier |
publish | True | Boolean | Yes | Determines if the freight is automatically published or only created |
payment | Object | No | Payment conditions for publication using groups or smart match | |
requirements | Object | Yes | Main freight requirements, including truck body and size adr classes, ways of loading | |
carriers | Array | Yes | Contains a list of carrier’s company identifiers (at least one of company id’s must be valid) | |
loads | Array | No | Collection of freights’ loads. It is possible to send empty array of loads, nevertheless an array has to be set | |
spots | Object | Yes | Collection of freights’ spots — at least one loading and one unloading is required |
Example request
Sample Json for creating new freight using required data only
{
"capacity": 12,
"requirements": {
"is_ftl": false,
"required_truck_bodies": [
"curtainsider"
],
"loads": []
},
"carriers": [
{
"company_id": 10
}
],
"spots": [
{
"spot_order": 1,
"place": {
"address": {
"country": "PL",
"postal_code": "12345",
"locality": "Wroclaw"
}
},
"operations": [
{
"timespans": {
"begin": "2021-02-03T13:00:00+0100",
"end": "2021-02-03T14:00:00+0100"
},
"type": "loading",
"operation_order": 1
}
]
},
{
"spot_order": 2,
"place": {
"address": {
"country": "DE",
"postal_code": "09876",
"locality": "Nürnberg"
}
},
"operations": [
{
"timespans": {
"begin": "2021-02-04T08:00:00+0100",
"end": "2021-02-04T08:00:00+0100"
},
"type": "unloading",
"operation_order": 1
}
]
}
],
"publish": true
}
Response
{
"accepted_price": null,
"capacity": 12,
"carrier": null,
"id": 592018,
"loading_meters": null,
"loads": [],
"publication_price": null,
"reference_number": "FR/2021/02/03/X64K",
"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-03T13:00:00+01:00",
"end": "2021-02-03T14:00:00+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-04T08:00:00+01:00",
"end": "2021-02-04T08:00:00+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"
}