Get toll costs for an auction by MongoDB ObjectId
GET/company/minimal/bid-auction
Retrieves toll information for an existing auction using its MongoDB ObjectId (_id).
Provides detailed toll data for the specific route associated with the auction.
Objective
Enable quick access to toll information for auctioned freight, facilitating transparent cost breakdown and bid validation.
Use Cases
- Display toll costs in auction details for carriers
- Validate bid amounts against toll costs
- Provide cost breakdown in auction summaries
- Support total cost calculations for bidding decisions
- Generate cost reports for completed auctions
Process Flow
- Query the auction by MongoDB
_id(ObjectId) - Populate the pickup (etl_address) and delivery (etd_address) addresses
- Extract GPS coordinates from the address location field
- Query the external toll API for the route
- Return toll data with start/end coordinates and costs
Response Information
- start: Origin GPS coordinates (lat, lng)
- end: Destination GPS coordinates (lat, lng)
- tolls: Array with route toll information
- tollCost: Total cost of all tolls in EUR
Error Responses
- 400: Missing or invalid auction ID
- 404: Auction with the specified ID not found
- 500: External toll service error or missing address coordinates
Request
Responses
- 200
- 400
- 404
- 500
Toll costs obtained correctly
Missing or invalid auction ID parameter
Auction not found
External toll service error