Creating a new route.
After successfully executing the method, you receive in response the route details with the unique route identification number id assigned when creating the new route.
POST
/ext/contracts-api/v2/routes
Request Authorization
Every request MUST include a valid access token obtained during the user authorization process, provided using the Bearer token scheme in the Authorization header.
Successful Response
Error Response
Request Header
POST /ext/contracts-api/v2/routes HTTP/1.1
Host: api.platform.trans.eu
Content-Type: application/json
Accept: application/json
Authorization: Bearer {access_token)
Api-key: {unique_app_api-key}Request Parameters
| Attribute | Type | Example | Mandatory | Description |
| distance | Object | No | Route distance | |
| distance.declared | Object | No | Route distance declared by user during configuration the route | |
| distance.declared.unit_code | String | “km” | No | Unit code fo declared distance. Default is km (kilometers) |
| distance.declared.value | Int | 150 | No | Value of declared distance |
| is_roundtrip | Boolean | False | No | Round trip route |
| loads | Array of Objects | No | Specification of loads parameters required on the route | |
| loads.amount | Int | 1 | No | Amount of load types within given load |
| loads.height | Object | No | Load height | |
| loads.height.unit_code | String | “m” | No | Unit of load height. Always is “m” (meters). |
| loads.height.value | Float | 2.3 | No | Value of load height (range 0.01–10) |
| loads.length | Object | No | Load length | |
| loads.length.unit_code | String | “m” | No | Unit of load length. Always is “m” (meters) |
| loads.length.value | Float | 1.2 | No | Value of load length (range 0.01–100) |
| loads.name | String | “Glass load” | No | Name of a load |
| loads.palletes | Object | No | Additional rules for pallets | |
| loads.palletes.is_exchangeable | Boolean | False | No | Determines if type of load is available for exchange at unloading place |
| loads.palletes.is_stackable | Boolean | False | No | Specifies whether the type of load allows stacking |
| loads.type_of_load | String | “europallete” | No | Supported load type (see dictionary) |
| loads.volume | Object | No | Load volume | |
| loads.volume.unit_code | String | “m3” | No | Unit of load volume. Always is “m3” |
| loads.volume.value | Float | 1.92 | No | Value of load volume (range 0.01–10000) |
| loads.weight | Object | No | Load weight | |
| loads.weight.max | Object | No | Min load weight | |
| loads.weight.max.unit_code | String | “t” | No | Unit of load weight. Always is “t” (tonnes) |
| loads.weight.max.value | Float | 2 | No | Value of load weight (range 0.001 – 100000) |
| loads.weight.min | Object | No | Max load weight | |
| loads.weight.min.unit_code | String | “t” | No | Unit of load weight. Always is “t” (tonnes) |
| loads.weight.min.value | Float | 2.4 | No | Value of load weight (range 0.001 – 100000) |
| loads.width | Object | No | Load width | |
| loads.width.unit_code | String | “m” | No | Unit of load width. Always is “m” (meters) |
| loads.width.value | Float | 2.1 | No | Value of load width (range 0.01–10) |
| name | String | “Route Warszawa-Berlin 1” | Yes | Name of the route |
| publication_scenario | Object | No | Definition of publication scenario for route | |
| publication_scenario.data | Object | No/Yes | Mandatory object for in_order scenario type | |
| publication_scenario.data.order | String | “gradually” | Yes | Order of publication to carrier list. Available values:gradually - after the specified publication time has elapsed, gradually add next recipientnext_recipient - after the specified publication time has elapsed, forwarding to the next recipient |
| publication_scenario.data.publication_time | Object | Yes | Publication period for one recipient | |
| publication_scenario.data.publication_time.unit_code | String | “s” | Yes | Unit time for time value. Always is “s” (seconds) |
| publication_scenario.data.publication_time.user_unit_code | String | “min” | Yes | Unit time indicated by user. Available values are “min” (minutes) or “h” (hours) |
| publication_scenario.data.publication_time.value | Int | 300 | Yes | Period of publication time in seconds. Range (300 — 432000). |
| publication_scenario.type | String | “in_order” | No | Publication scenario type. Available values:parallel - publication to all in parallel (default)in_order - publication in order of the carrier list |
| requirements | Object | No | Vehicle requirements | |
| requirements.additional_requirements | Array of Strings | No | Additional vehicle requirements (see dictionary) | |
| requirements.capacity | Object | No | Vehicle capacity | |
| requirements.capacity.max | Object | No | Vehicle max capacity | |
| requirements.capacity.max.unit_code | String | “t” | No | Unit of max capacity. Always is “t” (tonnes) |
| requirements.capacity.max.value | Float | 24 | No | Value of vehicle max capacity |
| requirements.capacity.min | Object | No | Vehicle min capacity | |
| requirements.capacity.min.unit_code | String | “t” | No | Unit of min capacity. Always is “t” (tonnes) |
| requirements.capacity.min.value | Float | 20 | No | Value of vehicle min capacity |
| requirements.exemption_from_adr | Boolean | False | No | The load can be transported by carrier without ADR authorization. It occurs only for additional_requirements = adr. |
| requirements.freight_type | String | “FTL” | No | Type of freight. Available values: FTL, LTL, MULTI_FTL, null |
| requirements.height | Object | No | Vehicle height | |
| requirements.height.unit_code | String | “m” | No | Unit of vehicle height. Always is “m” (meters) |
| requirements.height.value | Float | 2.1 | No | Value of vehicle height |
| requirements.length | Object | No | Vehicle length | |
| requirements.length.unit_code | String | “m” | No | Unit of vehicle length. Always is “m” (meters) |
| requirements.length.value | Float | 3.4 | No | Value of vehicle length |
| requirements.required_adr_classes | Array of Strings | No | ADR freight classes (see dictionary) | |
| requirements.required_truck_bodies | Array of Strings | No | Expected vehicle body types matched to selected vehicle_size (see dictionary). Array can contains max 5 values. | |
| requirements.required_ways_of_loading | Array of Strings | No | The way of loading/unloading vehicle. Acceptable values: back, side, top. | |
| requirements.shipping_remarks | String | “description” | No | Additional shipping remarks |
| requirements.vehicle_size | String | “any_size” | No | Expected vehicle size (see dictionary). Default value is any_size. If you select any_size all 4 basic types of vehicle size are automatically selected. |
| requirements.volume | Object | No | Vehicle volume | |
| requirements.volume.unit_code | String | “m3” | No | Unit of vehicle volume. Always is “m3” (cubic meters) |
| requirements.volume.value | Float | 12.1 | No | Value of vehicle volume |
| requirements.width | Object | No | Vehicle width | |
| requirements.width.unit_code | String | “m” | No | Unit of vehicle width. Always is “m” (meters) |
| requirements.width.value | Float | 2.3 | No | Value of vehicle width |
| spots | Array of Objects | Yes | Collection of routes’ spots. One loading and one unloading will occur. | |
| spots.id | String | “21b4c767-8119–4938-8957-aeef320c4b2e” | No | Spot id |
| spots.name | String | “Wrocław home point” | No | Name of spot |
| spots.place | Object | Yes | Information related to single place on route | |
| spots.place.address | Object | Yes | Address of the selected point | |
| spots.place.address.country | String | “pl” | Yes | Country using ISO values (see dictionary) |
| spots.place.address.detailed_location_id | Int | 123456 | No | Detailed location id |
| spots.place.address.foreign_id | Int | null | No | Foreign address id |
| spots.place.address.locality | String | Wrocław | No | City name |
| spots.place.address.location_id | Int | 234567 | No | Location id |
| spots.place.address.number | String | “2–4” | No | Property number |
| spots.place.address.postal_code | String | “51–546” | No | Postal code |
| spots.place.address.radius | Float | null | No | Radius |
| spots.place.address.street | String | “Racławicka” | No | Street name |
| spots.place.coordinates | Object | No | Longitude and latitude for selected point | |
| spots.place.coordinates.latitude | Float | 53.35801 | No | Latitude of the point along the route |
| spots.place.coordinates.longitude | Float | -2.16539 | No | Longitude of the point along the route |
| spots.type | String | “loading” | Yes | Available values: loading, unloading |
| unique_key | String | “Route-PL-DE‑1” | No | Route unique name |
Example Request Body
{
"unique_key": "route-123C",
"name": "PL - FR route",
"is_roundtrip": false,
"distance": {
"declared": {
"value": 1200,
"unit_code": "km"
}
},
"publication_scenario": {
"type": "in_order",
"data": {
"publication_time": {
"value": 11000,
"unit_code": "s",
"user_unit_code": "min"
},
"order": "next_recipient"
}
},
"requirements": {
"capacity": {
"min": {
"value": 12,
"unit_code": "t"
},
"max": {
"value": 23,
"unit_code": "t"
}
},
"required_truck_bodies": [
"cooler",
"curtainsider"
],
"required_ways_of_loading": [
"Side",
"Back"
],
"vehicle_size": "bus",
"freight_type": "FTL"
},
"spots": [
{
"type": "loading",
"place": {
"address": {
"locality": "Suwałki",
"postal_code": "52-234",
"country": "pl"
}
}
},
{
"type": "unloading",
"place": {
"address": {
"locality": "MARSYLIA",
"postal_code": "13014",
"country": "fr",
"street": "Boulevard Danielle Casanova",
"number": "151",
"location_id": 1436808
},
"coordinates": {
"latitude": 43.323447,
"longitude": 5.3740827
}
}
}
]
}Response Fields
| Attribute | Type | Example | Description |
| balancing | Object | Rules of choice next recipients for publication | |
| balancing.allowed_types | Array of Strings | Available types of balancing: contract_condition, freight_limit, manual, percentage_share, price_ascending | |
| balancing.data | Object | Additional information about balancing | |
| balancing.data.freight_limit | Object | Configuration of transport limits for freight_limit type of balancing. When publishing a freight, the order of carriers will be automatically determined so that no carrier receives more or less orders than the limit. | |
| balancing.data.freight_limit.max | Int | 10 | Max limit in % |
| balancing.data.freight_limit.min | Int | 60 | Min limit in % |
| balancing.type | String | “manual” | Balancing type selected for route |
| distance | Object | Route distance | |
| distance.declared | Object | Route distance declared by user during configuration of the route | |
| distance.declared.unit_code | String | “km” | Unit code fo declared distance. Default is km (kilometers) |
| distance.declared.value | Int | 150 | Value of declared distance |
| distance.calculated | Object | Route distance automatically calculated during configuration of the route. Always is null in the request. | |
| distance.calculated.unit_code | String | “km” | Unit code fo calculated distance. Default is km (kilometers) |
| distance.calculated.value | Int | 161 | Value of calculated distance |
| distance_match | Object | Kilometer range for route matching. Always is null in the request. | |
| distance_match.max | Object | Max range | |
| distance_match.max.unit_code | String | “km” | Unit code for max range. Default is km. |
| distance_match.max.value | Int | 140 | Value of max range. |
| distance_match.min | Object | Min range | |
| distance_match.min.unit_code | String | “km” | Unit code for min range. Default is km. |
| distance_match.min.value | Int | 170 | Value of min range. |
| id | String | “b998d30b-502d-4a50-a423-aca69aa7a756” | Route id |
| is_roundtrip | Boolean | False | Round trip route |
| loads | Array of Objects | Specification of loads parameters required on the route | |
| loads.amount | Int | 1 | Amount of load types within given load |
| loads.height | Object | Load height | |
| loads.height.unit_code | String | “m” | Unit of load height. Always is “m” (meters). |
| loads.height.value | Float | 2.3 | Value of load height (range 0.01–10) |
| loads.length | Object | Load length | |
| loads.length.unit_code | String | “m” | Unit of load length. Always is “m” (meters) |
| loads.length.value | Float | 1.2 | Value of load length (range 0.01–100) |
| loads.name | String | “Glass load” | Name of a load |
| loads.palletes | Object | Additional rules for pallets | |
| loads.palletes.is_exchangeable | Boolean | False | Determines if type of load is available for exchange at unloading place |
| loads.palletes.is_stackable | Boolean | False | Specifies whether the type of load allows stacking |
| loads.type_of_load | String | “europallete” | Supported load type (see dictionary) |
| loads.volume | Object | Load volume | |
| loads.volume.unit_code | String | “m3” | Unit of load volume. Always is “m3” |
| loads.volume.value | Float | 1.92 | Value of load volume (range 0.01–10000) |
| loads.weight | Object | Load weight | |
| loads.weight.max | Object | Min load weight | |
| loads.weight.max.unit_code | String | “t” | Unit of load weight. Always is “t” (tonnes) |
| loads.weight.max.value | Float | 2 | Value of load weight (range 0.001 – 100000) |
| loads.weight.min | Object | Max load weight | |
| loads.weight.min.unit_code | String | “t” | Unit of load weight. Always is “t” (tonnes) |
| loads.weight.min.value | Float | 2.4 | Value of load weight (range 0.001 – 100000) |
| loads.width | Object | Load width | |
| loads.width.unit_code | String | “m” | Unit of load width. Always is “m” (meters) |
| loads.width.value | Float | 2.1 | Value of load width (range 0.01–10) |
| name | String | “Route Warszawa-Berlin 1” | Route name |
| position | Int | 1 | Route position in the list of routes |
| publication_scenario | Object | Definition of publication scenario for route | |
| publication_scenario.data | Object | Object available only for in_order scenario type | |
| publication_scenario.data.order | String | “gradually” | Order of publication to carrier list. Available values:gradually - after the specified publication time has elapsed, gradually add next recipientnext_recipient - after the specified publication time has elapsed, forwarding to the next recipient |
| publication_scenario.data.publication_time | Object | Publication period for one recipient | |
| publication_scenario.data.publication_time.unit_code | String | “s” | Unit time for time value. Always is “s” (seconds) |
| publication_scenario.data.publication_time.user_unit_code | String | “min” | Unit time indicated by user. Available values are “min” (minutes) or “h” (hours) |
| publication_scenario.data.publication_time.value | Int | 300 | Period of publication time in seconds. |
| publication_scenario.type | String | “in_order” | Publication scenario type. Available values:parallel - publication to all in parallelin_order - publication in order of the carrier list |
| requirements | Object | Vehicle requirements | |
| requirements.additional_requirements | Array of Strings | Additional vehicle requirements (see dictionary) | |
| requirements.capacity | Object | Vehicle capacity | |
| requirements.capacity.max | Object | Vehicle max capacity | |
| requirements.capacity.max.unit_code | String | “t” | Unit of max capacity. Always is “t” (tonnes) |
| requirements.capacity.max.value | Float | 24 | Value of vehicle max capacity |
| requirements.capacity.min | Object | Vehicle min capacity | |
| requirements.capacity.min.unit_code | String | “t” | Unit of min capacity. Always is “t” (tonnes) |
| requirements.capacity.min.value | Float | 20 | Value of vehicle min capacity |
| requirements.exemption_from_adr | Boolean | False | The load can be transported by carrier without ADR authorization. It occurs only for additional_requirements = adr. |
| requirements.freight_type | String | “FTL” | Type of freight. Available values: FTL, LTL, MULTI_FTL, null |
| requirements.height | Object | Vehicle height | |
| requirements.height.unit_code | String | “m” | Unit of vehicle height. Always is “m” (meters) |
| requirements.height.value | Float | 2.1 | Value of vehicle height |
| requirements.length | Object | Vehicle length | |
| requirements.length.unit_code | String | “m” | Unit of vehicle length. Always is “m” (meters) |
| requirements.length.value | Float | 3.4 | Value of vehicle length |
| requirements.required_adr_classes | Array of Strings | ADR freight classes (see dictionary) | |
| requirements.required_truck_bodies | Array of Strings | Expected vehicle body types matched to selected vehicle_size (see dictionary). Array can contains max 5 values. | |
| requirements.required_ways_of_loading | Array of Strings | The way of loading/unloading vehicle. Acceptable values: back, side, top. | |
| requirements.shipping_remarks | String | “description” | Additional shipping remarks |
| requirements.vehicle_size | String | “any_size” | Expected vehicle size (see dictionary). Default value is any_size. If you select any_size all 4 basic types of vehicle size are automatically selected. |
| requirements.volume | Object | Vehicle volume | |
| requirements.volume.unit_code | String | “m3” | Unit of vehicle volume. Always is “m3” (cubic meters) |
| requirements.volume.value | Float | 12.1 | Value of vehicle volume |
| requirements.width | Object | Vehicle width | |
| requirements.width.unit_code | String | “m” | Unit of vehicle width. Always is “m” (meters) |
| requirements.width.value | Float | 2.3 | Value of vehicle width |
| shipment_summary | Object | ||
| shipment_summary.amount | Int | ||
| shipment_summary.distance | Object | ||
| shipment_summary.distance.unit_code | String | “km” | |
| shipment_summary.distance.value | Int | ||
| shipment_summary.price | Array of Object | ||
| shipment_summary.price.amount | Int | ||
| shipment_summary.price.currency | String | ||
| shipment_summary.weight | Object | ||
| shipment_summary.weight.unit_code | String | “t” | |
| shipment_summary.weight.value | Float | ||
| spots | Array of Objects | Collection of routes’ spots. One loading and one unloading will occur. | |
| spots.id | String | “21b4c767-8119–4938-8957-aeef320c4b2e” | Spot id |
| spots.name | String | “Wrocław home point” | Name of spot |
| spots.place | Object | Information related to single place on route | |
| spots.place.address | Object | Address of the selected point | |
| spots.place.address.country | String | “pl” | Country using ISO values (see dictionary) |
| spots.place.address.detailed_location_id | Int | 123456 | Detailed location id |
| spots.place.address.foreign_id | Int | null | Foreign address id |
| spots.place.address.locality | String | Wrocław | City name |
| spots.place.address.location_id | Int | 234567 | Location id |
| spots.place.address.number | String | “2–4” | Property number |
| spots.place.address.postal_code | String | “51–546” | Postal code |
| spots.place.address.radius | Float | null | Radius |
| spots.place.address.street | String | “Racławicka” | Street name |
| spots.place.coordinates | Object | Longitude and latitude for selected point | |
| spots.place.coordinates.latitude | Float | 53.35801 | Latitude of the point along the route |
| spots.place.coordinates.longitude | Float | -2.16539 | Longitude of the point along the route |
| spots.type | String | “loading” | Available values: loading, unloading |
| status | String | “active” | Route status. Always is active in the request. |
| suggested_calculated_route_id | String | “46575331–7f0a-4f31-acaf-abc8eb08e72d” | |
| unique_key | String | “Route-PL-DE‑1” | Route unique name |
| _stats | Object | Route statistics | |
| _stats.contracts | Object | Route contract statistics | |
| _stats.contracts.accepted | Int | 1 | Number of accepted contracts |
| _stats.contracts.active | Int | 1 | Number of active contracts |
| _stats.contracts.finished | Int | 1 | Number of finished contracts |
| _stats.contracts.finished_previously_accepted | Int | 0 | Number of finished contracts previously accepted |
| _stats.contracts.fixed | Int | 0 | Number of contracts with fixed price |
| _stats.contracts.flexible | Int | 0 | Number of contracts with flexible price |
| _stats.contracts.refused | Int | 1 | Number of refused contracts |
| _stats.contracts.registered | Int | 0 | Number of registered contracts |
| _stats.contracts.waiting_for_acceptance | Int | 2 | Number of contracts waiting for acceptance |
| _stats.contracts.waiting_for_carrier_offer | Int | 1 | Number of contracts waiting for carrier offer |
| _stats.contracts.waiting_for_initial_carrier_offer | Int | 0 | Number of contracts waiting for first carrier offer |
| _stats.contracts.waiting_for_shipper_offer | Int | 1 | Number of contracts waiting for shipper offer |
| _stats.transports | Object | Route transports statistics | |
| _stats.transports.awaiting | Object | Route transports awaiting for realization | |
| _stats.transports.awaiting.count | Int | Number of awaiting transports | |
| _stats.transports.awaiting.median_price | Float | Median price for transports awaiting for realization | |
| _stats.transports.cheapest_carrier_offer | |||
| _stats.transports.realized | Object | Route transports realized | |
| _stats.transports.realized.average_price | Float | Average price for realized transports | |
| _stats.transports.realized.count | Int | Number of realized transports |
Response Body
{
"id": "4cdd0500-d930-4c9c-b290-70636f9f4b1e",
"unique_key": "route-123C",
"name": "PL - FR route",
"publication_scenario": {
"type": "in_order",
"data": {
"publication_time": {
"value": 11000,
"unit_code": "s",
"user_unit_code": "min"
},
"order": "next_recipient"
}
},
"spots": [
{
"id": "ee71a76b-dff3-4ec7-bf41-74769f75c418",
"name": null,
"type": "loading",
"place": {
"address": {
"locality": "Suwałki",
"postal_code": "52-234",
"country": "pl",
"street": null,
"number": null,
"location_id": null,
"detailed_location_id": null,
"foreign_id": null,
"radius": null
},
"coordinates": {
"latitude": null,
"longitude": null
}
}
},
{
"id": "a3febb33-a682-4ce5-a290-08af9af9b00d",
"name": null,
"type": "unloading",
"place": {
"address": {
"locality": "MARSYLIA",
"postal_code": "13014",
"country": "fr",
"street": "Boulevard Danielle Casanova",
"number": "151",
"location_id": 1436808,
"detailed_location_id": null,
"foreign_id": null,
"radius": null
},
"coordinates": {
"latitude": 43.323447,
"longitude": 5.3740827
}
}
}
],
"distance": {
"declared": {
"value": 1200,
"unit_code": "km"
},
"calculated": null
},
"suggested_calculated_route_id": null,
"distance_match": {
"min": null,
"max": null
},
"is_roundtrip": false,
"requirements": {
"required_truck_bodies": [
"cooler",
"curtainsider"
],
"required_adr_classes": [],
"required_ways_of_loading": [
"side",
"back"
],
"additional_requirements": [],
"shipping_remarks": null,
"freight_type": "FTL",
"vehicle_size": "bus",
"width": null,
"height": null,
"length": null,
"volume": null,
"capacity": {
"min": {
"value": 12,
"unit_code": "t"
},
"max": {
"value": 23,
"unit_code": "t"
}
},
"exemption_from_adr": false
},
"loads": [
{
"name": null,
"type_of_load": null,
"amount": null,
"width": null,
"height": null,
"length": null,
"volume": null,
"weight": {
"min": null,
"max": null
},
"pallets": {
"is_stackable": false,
"is_exchangeable": false
}
}
],
"balancing": {
"type": "manual",
"allowed_types": [
"manual",
"contract_condition",
"freight_limit",
"percentage_share",
"price_ascending"
],
"data": {
"freight_limit": {
"min": null,
"max": null
}
}
},
"status": "active",
"shipments_summary": {
"amount": 0,
"weight": {
"value": 0,
"unit_code": "t"
},
"distance": {
"value": 0,
"unit_code": "km"
},
"price": [
{
"amount": null,
"currency": null
}
]
},
"position": 245,
"_stats": {
"contracts": {
"fixed": 0,
"flexible": 0
},
"transports": {
"realized": {
"average_price": null,
"count": 0
},
"awaiting": {
"median_price": null,
"count": null
},
"cheapest_carrier_offer": null
}
}
}Clients errors (code 400)
HTTP 4xx status codes indicate client errors, meaning that the request could not be processed due to an issue on the client side. Below is a list of request-specific errors.
Example error 1
No required ‘name’ field
{
"message": [
"name must be a string"
],
"error": "Bad Request",
"statusCode": 400,
"service_code": 5404
}Example error 2
No required ‘order’ field in publication scenario case
{
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
"title": "Unprocessable Entity",
"status": 422,
"detail": "Failed Validation",
"validation_messages": {
"publication_scenario": {
"data": {
"order": {
"isEnum": "order must be one of the following values: next_recipient, gradually"
}
}
}
}
}Example error 3
No required ‘spots.type’ field
{
"message": [
"spots.0.type must be a string"
],
"error": "Bad Request",
"statusCode": 400,
"service_code": 5404
}