Creating new freight and sending it to private exchange branded. To check private exchange branded id use that method first.
Url parameters and connection settings
- URL: https://api.platform.trans.eu
- Endpoint: /ext/freights-api/v1/freight-corporate
- 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.
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 |
contact_employees | [“12345-1”, “12345-2”] | Array | No | The default contact person is always the publisher. If the field is sent, the contact persons will be only the ID’s sent in it |
payment | Object | No | You can specify the value of the payment, the currency of the payment and the method of payment | |
requirements | Object | Yes | Main freight requirements, including truck body and size adr classes, ways of loading | |
exchanges | Object | Yes | Contains private exchange branded id | |
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
Sample Json for creating new freight using required data only
{ "capacity": 20, "requirements": { "is_ftl": true, "required_truck_bodies": [ "cooler" ] }, "publish": true, "spots": [ { "spot_order": 1, "place": { "address": { "country": "pl", "locality": "Wrocław", "postal_code": "53-146" } }, "operations": [ { "operation_order": 1, "timespans": { "end": "2022-12-16T12:00:00+0100", "begin": "2022-12-16T12:00:00+0100" }, "type": "loading" } ] }, { "spot_order": 2, "place": { "address": { "country": "pl", "locality": "Wrocław", "postal_code": "53-146" } }, "operations": [ { "operation_order": 1, "loads": [], "timespans": { "end": "2022-12-17T12:00:00+0100", "begin": "2022-12-17T12:00:00+0100" }, "type": "unloading" } ] } ], "exchanges": [ { "exchange_id": "b3a7b0f0-d7f4-4de8-aa6d-61b5d9bae999" } ] }
Response
{ "accepted_price": null, "capacity": 20, "carrier": null, "contact_employees": [ { "last_name": "Testowy", "name": "API", "trans_id": "1007386-5" } ], "distance": null, "end_reason": null, "height": null, "id": 1787718, "length": null, "loading_meters": null, "loads": [], "publication_price": { "currency": "eur", "value": null }, "publication_status": null, "reference_number": "FR/2022/12/15/215IJ", "requirements": { "is_ftl": true, "monitoring": "without_monitoring", "other_requirements": [], "required_adr_classes": [], "required_truck_bodies": [ "cooler" ], "required_ways_of_loading": [], "shipping_remarks": null, "temperature": { "max": null, "min": null }, "transport": { "count": null, "settlement": null, "type": "ftl", "units_per_transport": null }, "vehicle_size": "any_size" }, "shipment_external_id": null, "spots": [ { "description": null, "name": null, "operations": [ { "loads": [], "operation_order": 1, "operation_time": null, "timespans": { "begin": "2022-12-16T12:00:00+01:00", "end": "2022-12-16T12:00:00+01:00" }, "type": "loading" } ], "place": { "address": { "country": "pl", "description": null, "locality": "Wrocław", "number": null, "postal_code": "53-146", "street": null }, "coordinates": { "latitude": 51.079202595, "longitude": 16.993128942 } }, "spot_order": 1 }, { "description": null, "name": null, "operations": [ { "loads": [], "operation_order": 1, "operation_time": null "timespans": { "begin": "2022-12-17T12:00:00+01:00", "end": "2022-12-17T12:00:00+01:00" }, "type": "unloading" } ], "place": { "address": { "country": "pl", "description": null, "locality": "Wrocław", "number": null, "postal_code": "53-146", "street": null }, "coordinates": { "latitude": 51.079202595, "longitude": 16.993128942 } }, "spot_order": 2 } ], "status": "new", "transit_time": null, "volume": null, "width": null }