Description of vehicle API, allowed methods and requests, value types.
Description
Vehicle exchange API gives information about the availability of your vehicle fleet to other platform users who are looking for transport between the given locations. Vehicle offers are also one of the sources of vehicle availability for the smartmatch algorithm. Each vehicle offer is always visible to all platform users once it was created.
Using this API it is also possible to get all own vehicle offers.
Creating new vehicle offer
With the use of Trans.eu API it is possible to create new own vehicle offer, displayed in Trans.eu Platform in Vehicle exchange module.
Components of a single vehicle offer
Each vehicle offer consists of:
- loading place
- unloading place (or unloading places for more than one unloading spot)
- cargo (load)
- vehicle parameters
Validation rules
Most important validation rules considering freight publication
- all dates must be greater or equal today
- vehicle body type must be set according to dictionary
- loading place and unloading place
Important!
Weight is always represented in tonnes.
Height, length and width are always represented in meters.
Volume is always represented in cubic meters.
Structure of adding new vehicle
Json | Is required | Example | Type | Description |
contact_persons | No | “1011111–5”, “1011111–1” | Array | Field is not required, default contact person is creator. When you send that field in request, only typed Trans-Id’s will be assigned as contact persons. You can send max 3 Trans-Id’s. |
vehicle_size | Yes | Bus | String | Available vehicle sizes |
truck_body | Yes | Curtainsider | String | Allowed truck bodies |
adr_classes | No | Adr_1 | Array | Allowed ADR classes |
equipment | No | Lift, Hds | Array | Allowed equipment |
available_ways_of_loading | No | Top | Array | Allowed ways of loading |
loading_place | Yes | Object | — | Loading place |
loading_place.address | Yes | Object | — | Loading place address |
loading_place_address.locality | No | Wroclaw | String | City name |
loading_place_address.postal_code | No | 56–111 | String | Postal code |
loading_place_address.country | Yes | PL | String | Country using ISO values |
loading_place.coordinates | No | Object | — | Longitude and latitude for selected point |
loading_place.coordinates.latitude | No | 53.35801 | Float | Latitude of the point along the freight route |
loading_place.coordinates.longitude | No | 58.78801 | Float | Longitude of the point along the freight route |
loading_place.range | No | 50 | Int | Range must be one of the following values: 50,75,100,125,150,200,250 |
unloading_places | Yes | Object | — | Unloading places (you can send max 10 locations) |
unloading_places.address | Yes | Object | — | Unloading place address |
unloading_places.address.locality | No | Wroclaw | String | City name |
unloading_places.address.postal_code | No | 55–261 | String | Postal code |
unloading_places.address.country | Yes | PL | String | Country using ISO values |
unloading_places.coordinates | No | Object | — | Longitude and latitude for selected point |
unloading_places.coordinates.latitude | No | 53.36789 | Float | Latitude of the point along the freight route |
unloading_places.coordinates.longitude | No | 58.78999 | Float | Longitude of the point along the freight route |
unloading_places.range | No | 50 | Int | Range must be one of the following values: 50,75,100,125,150,200,250 |
cargo | Yes | Object | — | Cargo description |
cargo.height | No | 2.2 | Float | Cargo height |
cargo.width | No | 4 | Float | Cargo width |
cargo.length | No | 30 | Float | Cargo length |
cargo.volume | No | 40 | Float | Cargo volume |
cargo.capacity | Yes | 24 | Float | Cargo capacity |
available_on | Yes | Object | — | Vehicle availability |
available_on.begin | Yes | 2021–02-20T17:25:00+0000 | Timestamp | Vehicle availability begin |
available_on.end | Yes | 2021–02-21T19:25:00+0000 | Timestamp | Vehicle availability end |
Json example
{
"contact_persons": [
"1011111-5",
"1011111-1"
],
"vehicle_size": "bus",
"truck_body": "standard-tent",
"adr_classes": [
"adr_1"
],
"equipment": [
"lift"
],
"available_ways_of_loading": [
"top"
],
"loading_place": {
"address": {
"locality": "Wroclaw",
"postal_code": "56-111",
"country": "pl"
}
},
"unloading_places": [
{
"address": {
"locality": "Oława",
"country": "pl",
"postal_code": "55-200"
},
"coordinates": {
"longitude": 111,
"latitude": 0.11111
},
"range": 50
},
{
"address": {
"country": "gb"
}
}
],
"cargo": {
"capacity": 24,
"height": 2.2,
"width": 4,
"length": 30,
"volume": 40
},
"available_on": {
"begin": "2022-03-17T15:25:00+0000",
"end": "2022-03-17T19:25:00+0000"
}
}
Confirmation of posting vehicle
Json | Is required | Example | Type | Description |
id | No | 01EZPX4BV51513JQCBK7Y5V7K9 | String | Offer id assigned automatically during creation of a new vehicle |
Structure of getting single vehicle offer and list of vehicle offers created
Json | Is required | Example | Type | Description |
created_at | No | 2021–03-01T12:45:11+00:00 | Timestamp | Vehicle offer creation date |
expiration_date | No | 2021–03-01T19:25:00+0000 | Timestamp | Vehicle offer expiration date |
id | No | 01EZPX4BV51513JQCBK7Y5V7K9 | String | Vehicle offer id assigned automatically during creation |
offer_id | No | 202574219 | Int | Offer id from vehicle offers list |
vehicle | No | Object | — | Vehicle description |
vehicle.adr_classes | No | Adr_1 | Array | ADR classes list |
vehicle.available_on | No | Object | — | Vehicle availability |
vehicle.available_on.begin | No | 2021–02-20T17:25:00+0000 | Timestamp | Vehicle availability begin |
vehicle.available_on.end | No | 2021–02-20T19:25:00+0000 | Timestamp | Vehicle availability end |
vehicle.available_ways_of_loading | No | Top | Array | Allowed ways of loading |
vehicle.cargo | No | Object | — | Cargo description |
vehicle.cargo.height | No | 2.2 | Float | Cargo height |
vehicle.cargo.width | No | 4 | Float | Cargo width |
vehicle.cargo.length | No | 30 | Float | Cargo length |
vehicle.cargo.volume | No | 40 | Float | Cargo volume |
vehicle.cargo.capacity | No | 24 | Float | Cargo capacity |
vehicle.equipment | No | Lift, Hds | Array | Equipment list |
vehicle.size | No | Bus | String | Vehicle size |
vehicle.truck_body | No | Curtainsider | String | Truck body |
vehicle.loading_place | No | Object | — | Loading place |
vehicle.loading_place.address | No | Object | — | Loading place address |
vehicle.loading_place_address.locality | No | Wroclaw | String | City name |
vehicle.loading_place_address.postal_code | No | 56–111 | String | Postal code |
vehicle.loading_place_address.country | No | PL | String | Country using ISO values |
vehicle.loading_place.coordinates | No | Object | — | Longitude and latitude for selected point |
vehicle.loading_place.coordinates.latitude | No | 53.35801 | Float | Latitude of the point along the freight route |
vehicle.loading_place.coordinates.longitude | No | 58.78801 | Float | Longitude of the point along the freight route |
vehicle.loading_place.range | No | 50 | Int | Range |
vehicle.unloading_places | No | Object | — | Unloading place |
vehicle.unloading_places.address | No | Object | — | Unloading place address |
vehicle.unloading_places.address.locality | No | Wroclaw | String | City name |
vehicle.unloading_places.address.postal_code | No | 55–261 | String | Postal code |
vehicle.unloading_places.address.country | No | PL | String | Country using ISO values |
vehicle.unloading_places.coordinates | No | Object | — | Longitude and latitude for selected point |
vehicle.unloading_places.coordinates.latitude | No | 53.36789 | Float | Latitude of the point along the freight route |
vehicle.unloading_places.coordinates.longitude | No | 58.78999 | Float | Longitude of the point along the freight route |
vehicle.unloading_places.range | No | 50 | Int | Range |