Sandbox
Apply a sandbox scenario
Applies one deterministic scenario to a sandbox order. Use this route only with the sandbox base URL. The scenario list defines each supported order change.
POST
/
v2
/
test
/
orders
/
{order_id}
/
advance
Apply a sandbox scenario
curl --request POST \
--url https://sandbox.api.bahnexpress.fi/v2/test/orders/{order_id}/advance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"scenario": "pickup_readiness_confirmed"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({scenario: 'pickup_readiness_confirmed'})
};
fetch('https://sandbox.api.bahnexpress.fi/v2/test/orders/{order_id}/advance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox.api.bahnexpress.fi/v2/test/orders/{order_id}/advance"
payload = { "scenario": "pickup_readiness_confirmed" }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"scenario": "pickup_readiness_confirmed",
"order": {
"id": "ord_01k1a2b3c4d5e6f7g8h9j0k1m2",
"ordered_for": null,
"customer_reference": "PO-2026-1042",
"status": "accepted",
"pickup_readiness": "confirmed",
"created_at": "2026-07-30T13:00:00Z",
"updated_at": "2026-08-03T08:40:00+03:00",
"pickup": {
"address": {
"formatted_address": "Teollisuuskatu 1, 00510 Helsinki, Finland",
"name": null,
"address_line_1": "Teollisuuskatu 1",
"address_line_2": null,
"postal_code": "00510",
"city": "Helsinki",
"country_code": "FI",
"coordinates": {
"latitude": 60.188,
"longitude": 24.951
}
},
"type": "dealership",
"contact": null,
"release_code": null,
"available_from": "2026-08-03T08:00:00+03:00",
"requested_windows": [],
"agreed_window": null,
"eta": "2026-08-03T08:40:00+03:00",
"eta_updated_at": "2026-08-03T08:35:00+03:00",
"actual_at": null
},
"delivery": {
"address": {
"formatted_address": "Hatanpään valtatie 24, 33100 Tampere, Finland",
"name": null,
"address_line_1": "Hatanpään valtatie 24",
"address_line_2": null,
"postal_code": "33100",
"city": "Tampere",
"country_code": "FI",
"coordinates": {
"latitude": 61.489,
"longitude": 23.766
}
},
"type": "dealership",
"contact": null,
"requested_windows": [],
"agreed_window": null,
"commitment_deadline_at": null,
"eta": null,
"eta_updated_at": null,
"actual_at": null
},
"items": [
{
"id": "item_01k1a2b3c4d5e6f7g8h9j0k1m2_primary",
"role": "primary",
"status": "awaiting_pickup",
"vin": "WBA00000000000001",
"registration_number": null,
"make": null,
"model": null,
"note": null,
"fuel_type": "unknown",
"transmission": "unknown",
"engine_power_kw": null,
"first_registered_year": null,
"kerb_weight_kg": null,
"cmr": "digital",
"plates": "none",
"pickup_condition": null,
"delivery_condition": null,
"winter_tires": {
"mounted": false,
"in_vehicle": false
}
}
],
"service_options": {
"transport_preference": "flexible",
"inspection": "standard"
},
"price": {
"currency": "EUR",
"total_cents": 45900,
"transport_cents": 43900,
"additional_fees_cents": 2000,
"trade_in_cents": 0
},
"customer_note": null,
"allowed_actions": [
"update",
"cancel",
"get_files",
"get_inspection_report",
"get_tracking"
],
"revision": "x5Bm9Qa2Kd7Rv1Nu4Le8Yc3Hj6Wp0Tg5FsZiAoUkEnM"
}
}{
"type": "https://api.bahnexpress.fi/problems/validation-error",
"title": "The request is invalid.",
"status": 400,
"code": "validation_error",
"detail": "One or more fields are invalid.",
"instance": "/v2/orders",
"request_id": "req_01k1a2b3c4d5e6f7g8h9j0k1m2",
"errors": [
{
"path": "items.0.vin",
"code": "invalid_length",
"message": "The VIN must contain 17 characters."
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}Authorizations
OAuth 2.0 client credentials.
Headers
A unique key for this logical write.
Required string length:
8 - 255A caller-supplied request identifier for support.
Required string length:
1 - 255Path Parameters
The order identifier. Stable Bahn order identifier used in every order resource path.
Pattern:
^ord_[a-z0-9]+$Body
application/json
Scenario to apply to one sandbox order.
Named state change to apply. Its current-state precondition must be satisfied.
Available options:
pickup_readiness_confirmed, pickup_approach_started, pickup_nearby, pickup_completed, delivery_eta_changed, inspection_completed, files_published, tracking_available, tracking_unavailable, tracking_paused, delivery_completed, cancelled Optional event time for deterministic tests. Defaults to the current time.
Response
The sandbox applied the scenario.
Applied scenario and the resulting current order.
Scenario that was applied.
Available options:
pickup_readiness_confirmed, pickup_approach_started, pickup_nearby, pickup_completed, delivery_eta_changed, inspection_completed, files_published, tracking_available, tracking_unavailable, tracking_paused, delivery_completed, cancelled Current order after the scenario.
Show child attributes
Show child attributes
⌘I
Apply a sandbox scenario
curl --request POST \
--url https://sandbox.api.bahnexpress.fi/v2/test/orders/{order_id}/advance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"scenario": "pickup_readiness_confirmed"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({scenario: 'pickup_readiness_confirmed'})
};
fetch('https://sandbox.api.bahnexpress.fi/v2/test/orders/{order_id}/advance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox.api.bahnexpress.fi/v2/test/orders/{order_id}/advance"
payload = { "scenario": "pickup_readiness_confirmed" }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"scenario": "pickup_readiness_confirmed",
"order": {
"id": "ord_01k1a2b3c4d5e6f7g8h9j0k1m2",
"ordered_for": null,
"customer_reference": "PO-2026-1042",
"status": "accepted",
"pickup_readiness": "confirmed",
"created_at": "2026-07-30T13:00:00Z",
"updated_at": "2026-08-03T08:40:00+03:00",
"pickup": {
"address": {
"formatted_address": "Teollisuuskatu 1, 00510 Helsinki, Finland",
"name": null,
"address_line_1": "Teollisuuskatu 1",
"address_line_2": null,
"postal_code": "00510",
"city": "Helsinki",
"country_code": "FI",
"coordinates": {
"latitude": 60.188,
"longitude": 24.951
}
},
"type": "dealership",
"contact": null,
"release_code": null,
"available_from": "2026-08-03T08:00:00+03:00",
"requested_windows": [],
"agreed_window": null,
"eta": "2026-08-03T08:40:00+03:00",
"eta_updated_at": "2026-08-03T08:35:00+03:00",
"actual_at": null
},
"delivery": {
"address": {
"formatted_address": "Hatanpään valtatie 24, 33100 Tampere, Finland",
"name": null,
"address_line_1": "Hatanpään valtatie 24",
"address_line_2": null,
"postal_code": "33100",
"city": "Tampere",
"country_code": "FI",
"coordinates": {
"latitude": 61.489,
"longitude": 23.766
}
},
"type": "dealership",
"contact": null,
"requested_windows": [],
"agreed_window": null,
"commitment_deadline_at": null,
"eta": null,
"eta_updated_at": null,
"actual_at": null
},
"items": [
{
"id": "item_01k1a2b3c4d5e6f7g8h9j0k1m2_primary",
"role": "primary",
"status": "awaiting_pickup",
"vin": "WBA00000000000001",
"registration_number": null,
"make": null,
"model": null,
"note": null,
"fuel_type": "unknown",
"transmission": "unknown",
"engine_power_kw": null,
"first_registered_year": null,
"kerb_weight_kg": null,
"cmr": "digital",
"plates": "none",
"pickup_condition": null,
"delivery_condition": null,
"winter_tires": {
"mounted": false,
"in_vehicle": false
}
}
],
"service_options": {
"transport_preference": "flexible",
"inspection": "standard"
},
"price": {
"currency": "EUR",
"total_cents": 45900,
"transport_cents": 43900,
"additional_fees_cents": 2000,
"trade_in_cents": 0
},
"customer_note": null,
"allowed_actions": [
"update",
"cancel",
"get_files",
"get_inspection_report",
"get_tracking"
],
"revision": "x5Bm9Qa2Kd7Rv1Nu4Le8Yc3Hj6Wp0Tg5FsZiAoUkEnM"
}
}{
"type": "https://api.bahnexpress.fi/problems/validation-error",
"title": "The request is invalid.",
"status": 400,
"code": "validation_error",
"detail": "One or more fields are invalid.",
"instance": "/v2/orders",
"request_id": "req_01k1a2b3c4d5e6f7g8h9j0k1m2",
"errors": [
{
"path": "items.0.vin",
"code": "invalid_length",
"message": "The VIN must contain 17 characters."
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"instance": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}