https://sandbox.api.bahnexpress.fi.
Sandbox credentials, orders, files, webhook endpoints, signing secrets, events, and tracking snapshots stay separate from production data.
Prepare the environment
Create a sandbox credential and webhook endpoint on the Customer API page in the Bahn portal. Sandbox address responses use the structured address fields that you send. Includecountry_code in each address.
An ordering channel can use any supported test business ID. The sandbox creates an isolated customer when no test customer matches.
The supported country codes are FI, DK, DE, and PL.
Apply a scenario
Create a normal order, then callPOST /v2/test/orders/{order_id}/advance.
The call needs the test:write scope and an idempotency key. The optional occurred_at field makes the test time deterministic.
The response contains the current order. It does not replace webhook delivery.
Test the main order flow
Apply these scenarios in order for a standard transport flow:
Read the related resource and verify the signed webhook after each scenario.
Test optional states
Create the order with
inspection: full before you test inspection_completed.
Use one of the named scenarios. A request fails when the scenario does not match the current order state.
Move from sandbox to production
Sandbox prices, times, files, and positions are test data. They do not predict a production result. Use/v2/test routes only with the sandbox base URL.
Sandbox webhooks use the normal event and signature formats. Test every event type through your sandbox endpoint before production use.