Skip to main content
Create and read one transport order for your own Bahn account. You need curl, jq, uuidgen, and a sandbox credential from Customer API in the Bahn portal. The request omits ordered_for because the transport belongs to your company. In your own system, link the returned Bahn order ID to the record that initiated the transport.
Keep the sandbox base URL in every command. The production URL creates real transport orders.
1

Set your sandbox credentials

Set the client ID and client secret from the portal. Generate one run ID for this tutorial. Keep it when retrying a request. Start again with a new run ID when creating another test order.
2

Get an access token

Request a token and save it. The token is valid for 15 minutes.
3

Create an order

Create one transport between two dealerships. Set available_from to a future time before you run the command.
A successful response has the accepted status. Save the returned id for later requests.
4

Read the current order

Read the order with its Bahn order ID.
The response should contain your order ID, the accepted status, and the current allowed_actions.
5

Advance the test order

Confirm pickup readiness with the first sandbox scenario. This gives you a real state change to read and later test through webhooks.
The response should show pickup_readiness_confirmed and the confirmed readiness value.
You have created, read, and advanced a sandbox order. Next, use Integration lifecycle to connect this flow to your own records and keep them current.