ordered_for. Add the capabilities your workflow needs after the first order works. Quickstart provides that first complete request.
The core loop
Once order creation and reads work, subscribe to webhooks for the changes your system needs. A webhook tells you what changed. The resource tells you what is true now. This distinction matters when events arrive late, arrive more than once, or arrive in a different order.Store the right identifiers
After order creation, store these values together:
Do not build a second version of the order lifecycle from webhook events. Store the data your system needs, then refresh it from the API after relevant events.
Add the capabilities your workflow needs
Make reads event-driven
Read the order when your workflow needs its current status, timing, or available actions. Use webhooks to refresh stored records after relevant changes. If you show a live map, poll the tracking resource every 30 to 60 seconds while it is visible. The event payload containsdata.resource_url. Tracking, file, and inspection events point to their own resources. Order events point to the order. Use data.related_resource_urls when one change affects more than one resource.
Keep writes deliberate
Create one idempotency key for each logical write that requires it. Reuse it for retries of the same operation and request data. Before an update or cancellation, read the latest order. Checkallowed_actions, then send the current revision inside double quotation marks in If-Match. If Bahn returns revision_conflict, read the order again and make a new decision.
Ordering for other businesses
If your platform arranges transport for its business users, follow Platform ordering. This track addsordered_for, eligibility checks, and business context in storage and webhook routing.
Continue with Orders and timing for the order model, or Webhooks for the event-processing flow.