Show the current ETA
The pickup and delivery ETAs are in the order, not in the tracking resource. Pickup and delivery times explains which time to show and when Bahn sends an ETA event.Read one tracking entry per vehicle
CallGET /v2/orders/{order_id}/tracking. The response contains one entry for each order item, so the primary vehicle and trade-in vehicle can have different tracking states and positions.
Use the item id to join each tracking entry to the matching vehicle in the order.
Tracking state
The
phase is pickup before collection and transport after collection.
A driver booking does not start tracking. The state stays not_started until the driver starts to travel to pickup. Order status shows the booked drivers.
Position
Whenposition is present, render position.point as one GeoJSON map marker. Use accuracy_meters for an accuracy circle and heading_degrees for marker direction when those values are available.
Show observed_at near the map. It is the time when Bahn observed the position, not the time when your application fetched it.
During a short location gap, the same position can remain available with its original observed_at. Keep the marker stable and let the timestamp show its age. When tracking is paused, position is null and the map should not show a live marker.
Show pickup approach
pickup_progress helps the seller prepare for handover:
Once progress becomes
nearby, it remains nearby for that pickup approach. Use this field directly. A map position does not mean that the driver is nearby or has arrived.
driver.name can contain the known driver’s full name during pickup approach. Show it when present and omit the driver element when it is null.
Refresh the map efficiently
The tracking response includes an ETag. Send it inIf-None-Match on the next request:
304 response means that the tracking snapshot did not change. Poll every 30 to 60 seconds while the map is visible, and stop when the user leaves the page or tracking reaches ended.
Bahn does not send a webhook for each position. Tracking webhooks tell you about state or pickup-progress changes; polling keeps the marker current while the map is open.