Publishing new freight using previously created (at Platform) 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}
- Api-key: {unique_app_api_key}
Authorization
Authorization process is described here.
Freight publication and content
For information about freight payload please refer to freight description.
Publication using automation rules does not require any additional fields or settings. Please remember to set publish parameter to true.
Automation rule must be created manually at the Trans.eu Platform (automation rule creation instruction). To apply automation rule for freights created using api, while creating a rule at Platform you need to check the checkbox — Apply the rule for matching freights automatically.
Freight payload for publication using automation rules does not contain price, but payment period and currency are transferred automatically from created rule.
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 |
publish | True | Boolean | Yes | Determines if the freight is automatically published or only created |
requirements | Object | Yes | Main freight requirements, including truck body and size adr classes, ways of loading | |
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
{
"external_source": "1_api",
"publish": true,
"capacity": 15,
"requirements": {
"is_ftl": true,
"required_truck_bodies": [
"cooler"
]
},
"loads": [],
"spots": [
{
"spot_order": 1,
"operations": [
{
"type": "loading",
"timespans": {
"begin": "2021-02-02T15:00:00+0000",
"end": "2021-02-02T16:00:00+0000"
},
"operation_order": 1
}
],
"place": {
"address": {
"country": "PL",
"postal_code": "96-500",
"locality": "Sochaczew"
}
}
},
{
"spot_order": 2,
"operations": [
{
"type": "unloading",
"timespans": {
"begin": "2021-02-03T21:59:59+0000",
"end": "2021-02-03T21:59:59+0000"
},
"operation_order": 1
}
],
"place": {
"address": {
"country": "PL",
"postal_code": "50-261",
"locality": "Wrocław"
}
}
}
]
}
Response
{
"accepted_price": null,
"capacity": 15,
"carrier": null,
"id": 591645,
"loading_meters": null,
"loads": [],
"publication_price": null,
"reference_number": "FR/2021/02/02/X6T3",
"requirements": {
"is_ftl": true,
"other_requirements": [],
"required_adr_classes": [],
"required_truck_bodies": [
"cooler"
],
"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-02T16:00:00+01:00",
"end": "2021-02-02T17:00:00+01:00"
},
"type": "loading"
}
],
"place": {
"address": {
"country": "pl",
"description": null,
"locality": "Sochaczew",
"number": null,
"postal_code": "96-500",
"street": null
},
"coordinates": {
"latitude": 52.22944,
"longitude": 20.23838
}
},
"spot_order": 1
},
{
"description": null,
"name": null,
"operations": [
{
"loads": [],
"operation_order": 1,
"timespans": {
"begin": "2021-02-03T22:59:59+01:00",
"end": "2021-02-03T22:59:59+01:00"
},
"type": "unloading"
}
],
"place": {
"address": {
"country": "pl",
"description": null,
"locality": "Wrocław",
"number": null,
"postal_code": "50-261",
"street": null
},
"coordinates": {
"latitude": 51.119967228399,
"longitude": 17.039585180639
}
},
"spot_order": 2
}
],
"status": "new"
}