Skip to main content

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

  1. Query the auction by MongoDB _id (ObjectId)
  2. Populate the pickup (etl_address) and delivery (etd_address) addresses
  3. Extract GPS coordinates from the address location field
  4. Query the external toll API for the route
  5. 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

Toll costs obtained correctly