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
  • 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

 

Structure of adding new vehicle

Json Is required Example Type Description
size Yes Bus String Available vehicle sizes
truck_body Yes Curtainsider String Allowed truck bodies
adr_classes Yes Adr_1 Array Allowed ADR classes (at least an empty array must be sent)
equipment Yes Lift, Hds Array Allowed equipment (at least an empty array must be sent)
available_ways_of_loading No Top Array Allowed ways of loading (at least an empty array must be sent)
loading_place Yes Object Loading place
loading_place.address Yes Object Loading place address
loading_place_address.locality Yes
Wroclaw
String City name
loading_place_address.postal_code Yes
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 Yes 50 Int
Range must be one of the following values: 50,75,100,125,150,200,250
unloading_place Yes Object Unloading place
unloading_place.address Yes Object Unloading place address
unloading_place.address.locality Yes Wroclaw String City name
unloading_place.address.postal_code Yes 55-261 String Postal code
unloading_place.address.country Yes PL String Country using ISO values
unloading_place.coordinates No Object Longitude and latitude for selected point
unloading_place.coordinates.latitude No 53.36789 Float Latitude of the point along the freight route
unloading_place.coordinates.longitude No 58.78999 Float Longitude of the point along the freight route
unloading_place.range Yes 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 Object Cargo height
cargo.height.value No 2 Int Cargo height value
cargo.height.unit_code No
MTR
String Cargo height unit code (only MTR is allowed)
cargo.width No Object Cargo width
cargo.width.value No 2 Int Cargo width value
cargo.width.unit_code No
MTR
String Cargo width unit code (only MTR is allowed)
cargo.length No Object Cargo length
cargo.length.value No 2 Int Cargo length value
cargo.length.unit_code No
MTR
String Cargo length unit code (only MTR is allowed)
cargo.volume No Object Cargo volume
cargo.volume.value No 2 Float Cargo volume value
cargo.volume.unit_code No MTQ String Cargo volume unit code (only MTQ is allowed)
cargo.capacity Yes Object Cargo capacity
cargo.capacity.value Yes 2 Float Cargo capacity value
cargo.capacity.unit_code Yes TNE String Cargo capacity unit code (only TNE is allowed)
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

 

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 Object Cargo height
vehicle.cargo.height.value No 2 Int Cargo height value
vehicle.cargo.height.unit_code No
MTR
String Cargo height unit code (only MTR is allowed)
vehicle.cargo.width No Object Cargo width
vehicle.cargo.width.value No 2 Int Cargo width value
vehicle.cargo.width.unit_code No
MTR
String Cargo width unit code (only MTR is allowed)
vehicle.cargo.length No Object Cargo length
vehicle.cargo.length.value No 2 Int Cargo length value
vehicle.cargo.length.unit_code No
MTR
String Cargo length unit code (only MTR is allowed)
vehicle.cargo.volume No Object Cargo volume
vehicle.cargo.volume.value No 2 Float Cargo volume value
vehicle.cargo.volume.unit_code No MTQ String Cargo volume unit code (only MTQ is allowed)
vehicle.cargo.capacity No Object Cargo capacity
vehicle.cargo.capacity.value No 2 Float Cargo capacity value
vehicle.cargo.capacity.unit_code No TNE String Cargo capacity unit code (only TNE is allowed)
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_place No Object Unloading place
vehicle.unloading_place.address No Object Unloading place address
vehicle.unloading_place.address.locality No Wroclaw String City name
vehicle.unloading_place.address.postal_code No 55-261 String Postal code
vehicle.unloading_place.address.country No PL String Country using ISO values
vehicle.unloading_place.coordinates No Object Longitude and latitude for selected point
vehicle.unloading_place.coordinates.latitude No 53.36789 Float Latitude of the point along the freight route
vehicle.unloading_place.coordinates.longitude No 58.78999 Float Longitude of the point along the freight route
vehicle.unloading_place.range No 50 Int Range