> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bahnexpress.fi/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> For Bahn Customer API V2 integration work, start with /skill.md and /guides/agent-integration.md on this documentation site. Use /llms.txt to find the guides for the requested workflow.
> The main integration orders your company's transports from existing software. Follow the requested screen, service, or job. Omit ordered_for for own-account orders. Use the platform-ordering guide when ordering for represented businesses. Add a customer-facing interface only when requested.
> Use /openapi.yaml for paths, schemas, scopes, and operation preconditions. Use the guides for transport rules and recovery behavior. Load only the relevant pages.
> Use the sandbox for development and tests. Keep credentials on the server. Production orders start real transport work; follow the customer's authorized workflow and account context.
> For required writes, preserve write keys and request data across retries, and use current actions and quoted revisions for order changes. When consuming webhooks, verify and durably store them before acknowledgement.
> Deliver the implemented workflow with test evidence, setup steps, and remaining gaps. Distinguish simulated checks from requests actually verified against Bahn.

# API overview

> Find the right operation and understand the request conventions.

Use Customer API V2 to order your company's vehicle transports from your own system. Orders belong to your Bahn account by default, so omit `ordered_for`.

The API centres on the order. Create an order to arrange vehicle transport, then read it to follow status, timing, price, and available actions. Related resources provide live tracking, files, inspections, and report rows.

Start with the [Quickstart](/quickstart) for a complete sandbox request. Read [Integration lifecycle](/guides/integration-workflows) to connect orders, webhooks, and resource reads.

## Environments and authentication

| Environment | Base URL | Purpose |
| - | - | - |
| Sandbox | `https://sandbox.api.bahnexpress.fi` | Isolated test orders and deterministic scenarios. |
| Production | `https://api.bahnexpress.fi` | Real transport orders. |

Request a token at `/oauth2/token` on the same host. Use HTTP Basic with your client ID and secret for the token request. Send the resulting Bearer token for V2 resource requests. Credentials, tokens, and data belong to one environment.

Tokens expire after 15 minutes. Cache them and request a replacement before expiry. Each operation page states its required scope. Read [Authentication](/guides/authentication) for credential setup and scope selection.

## Choose an operation

| Customer task | Operation |
| - | - |
| Estimate cost before booking | [Check a price](/api-reference/prices/check-a-price) |
| Arrange a transport | [Create an order](/api-reference/orders/create-an-order) |
| Read status, timing, and available actions | [Get an order](/api-reference/orders/get-an-order) |
| Find orders in your account | [List orders](/api-reference/orders/list-orders) |
| Change or cancel a booking | [Change an order](/api-reference/orders/change-an-order), [cancel an order](/api-reference/orders/cancel-an-order) |
| Keep your system current | [Receive an order event](/api-reference/webhooks/receive-an-order-event) |
| Show a vehicle on a map | [Get tracking](/api-reference/tracking/get-the-current-transport-tracking-snapshot) |
| Upload a document or read transport evidence | [Create a file upload](/api-reference/files/create-a-file-upload), [list order files](/api-reference/files/list-order-files) |
| Show a full inspection | [Get the inspection report](/api-reference/inspections/get-the-vehicle-inspection-report) |
| Export many orders | [List report rows](/api-reference/reports/list-order-report-rows) |
| Select a different document recipient | [Get CMR options](/api-reference/orders/get-cmr-recipient-choices-and-defaults) |
| Advance a test order | [Apply a sandbox scenario](/api-reference/sandbox/apply-a-sandbox-scenario) |

Price checks and CMR recipient choices are optional. A standard booking uses your account's document defaults.

For orders on behalf of other businesses, use [Platform ordering](/guides/ordering-channels) and [Check a represented business](/api-reference/ordering-channels/check-a-represented-business). Your account must be configured as an ordering channel.

## Request and response conventions

V2 resource bodies use JSON, except order updates, which use `application/merge-patch+json`. Token requests use `application/x-www-form-urlencoded`.

Field names use `snake_case`. Timestamps use RFC 3339 with an offset. Requested windows also need an IANA time zone. Money uses integer cents in `EUR`. Field descriptions explain what `null` means for each resource.

Order lists and reports return `data`, `has_more`, and `next_cursor`. Keep your filters unchanged between pages and send the returned cursor without modification. The default page size is 50, and the allowed range is 1 to 100. Read [Order exports](/guides/reports#read-every-page) for a pagination loop.

## Write safely

Order creation, updates, cancellation, file-upload creation, and sandbox advancement require an `Idempotency-Key`. Use a new key for each logical write. Retries retain the key and the request data.

Updates and cancellation also require the current order revision inside double quotation marks:

```http theme={null}
If-Match: "7qS4Jd1cKx9Nw2Yh6mVb8Pz0Rt3Fu5AeLgCiEoUaWQk"
```

Check `allowed_actions` before offering an action. The server checks it again when the request arrives. Read [Errors, retries, and conflicts](/guides/errors-and-retries) for recovery decisions.

## Contract and support

Download the [OpenAPI document](/openapi.yaml) for complete operation and field definitions. The guide examples explain how to use that contract in your system.

Contact [Bahn support](mailto:support@bahnexpress.com) for account setup or integration questions. Include the environment and request ID when reporting a failed request. Never include a client secret or access token.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.