application/problem+json. The OAuth token endpoint uses standard OAuth error responses.
Branch on the stable code, not the human-readable message. Include the request_id when you contact Bahn support.
Read a problem response
errors array can identify more than one invalid field. Do not parse the human message to select a program action.
Choose a retry action
Set a maximum retry count. Do not retry a permanent
4xx error without a request change.
Use idempotency keys
Order commands and file-upload creation need anIdempotency-Key. File deletion is idempotent without this header.
Create one key for one logical write. Reuse the same key after a timeout or server error.
Use a new key for a new logical write. Do not reuse a key with a different body.
Use order revisions
Order update and cancellation requests needIf-Match. Set it to the current order revision.
Read the order again after a revision conflict. Do not overwrite a newer order without a new decision.
A live ETA update does not change the order revision.
Store request IDs
You can sendX-Request-ID. The response also includes a request ID.
Store the request ID with each write result. Send it to support@bahnexpress.com when you report a problem.