Calculate transportation costs from city names (POST variant)
POST/company/minimal/costs-routes
Calculate transportation costs for an origin-destination pair using city names as location identifiers instead of coordinates or database IDs. This is the POST variant of the cost calculation, which accepts data in the request body.
Objective
To provide an easy-to-use cost calculation endpoint via human-readable city names, useful for integrations where coordinates are not available.
Use Cases
- Calculate costs using city names instead of coordinates
- Integration from external systems that send city-based data
- Quick cost estimation for planning tools
- Comparison of carrier rates by route name
Request Format
Expects a JSON object with:
- origin (required): Name of the origin city (e.g., Madrid, Barcelona)
- destination (required): Name of the destination city (e.g., Vigo, Bilbao)
- with_tolls (optional): Include toll costs in the calculation (default: false)
Calculation Method
Uses the same calculation engine as GET /company/minimal/costs:
- The external routing API provides base costs
- Fuel cost based on distance and average consumption
- Toll costs when
with_tolls=true - Maintenance costs (oil, tires, clutch, etc.)
- Time/duration costs
External Integration
This endpoint integrates with the Transcend routing service to provide accurate route and toll data for European routes.
Error Responses
- 400: Invalid request body or missing required fields
- 404: Origin or destination location not found
- 500: External routing service error
Request
Responses
- 200
- 400
- 404
- 500
Cost calculation completed successfully
Invalid request body
Location not found
External service error