Files
Delete a customer upload
Remove a customer upload when the file is eligible for deletion.
DELETE
/
v2
/
orders
/
{order_id}
/
files
/
{file_id}
Delete a customer upload
curl --request DELETE \
--url https://sandbox.api.bahnexpress.fi/v2/orders/{order_id}/files/{file_id} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://sandbox.api.bahnexpress.fi/v2/orders/{order_id}/files/{file_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox.api.bahnexpress.fi/v2/orders/{order_id}/files/{file_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text){
"type": "https://api.bahnexpress.fi/problems/authentication-failed",
"title": "The access token is not valid.",
"status": 401,
"code": "authentication_failed",
"instance": "/v2/orders/ord_01k1a2b3c4d5e6f7g8h9j0k1m2/files/file_01k1a2b3c4d5e6f7g8h9j0k1m2",
"request_id": "req_01k1a2b3c4d5e6f7g8h9j0k1m2"
}{
"type": "https://api.bahnexpress.fi/problems/permission-denied",
"title": "The access token does not have the required scope.",
"status": 403,
"code": "permission_denied",
"instance": "/v2/orders/ord_01k1a2b3c4d5e6f7g8h9j0k1m2/files/file_01k1a2b3c4d5e6f7g8h9j0k1m2",
"request_id": "req_01k1a2b3c4d5e6f7g8h9j0k1m2",
"detail": "The orders:write scope is required."
}{
"type": "https://api.bahnexpress.fi/problems/resource-not-found",
"title": "The file could not be deleted.",
"status": 404,
"code": "resource_not_found",
"instance": "/v2/orders/ord_01k1a2b3c4d5e6f7g8h9j0k1m2/files/file_01k1a2b3c4d5e6f7g8h9j0k1m2",
"request_id": "req_01k1a2b3c4d5e6f7g8h9j0k1m2",
"detail": "The file does not exist."
}{
"type": "https://api.bahnexpress.fi/problems/order-not-updateable",
"title": "The file could not be deleted.",
"status": 409,
"code": "order_not_updateable",
"instance": "/v2/orders/ord_01k1a2b3c4d5e6f7g8h9j0k1m2/files/file_01k1a2b3c4d5e6f7g8h9j0k1m2",
"request_id": "req_01k1a2b3c4d5e6f7g8h9j0k1m2",
"detail": "This order can no longer change."
}{
"type": "https://api.bahnexpress.fi/problems/internal-error",
"title": "The server could not complete the request.",
"status": 500,
"code": "internal_error",
"instance": "/v2/orders/ord_01k1a2b3c4d5e6f7g8h9j0k1m2/files/file_01k1a2b3c4d5e6f7g8h9j0k1m2",
"request_id": "req_01k1a2b3c4d5e6f7g8h9j0k1m2"
}{
"type": "https://api.bahnexpress.fi/problems/internal-error",
"title": "The server could not complete the request in time.",
"status": 503,
"code": "internal_error",
"instance": "/v2/orders/ord_01k1a2b3c4d5e6f7g8h9j0k1m2/files/file_01k1a2b3c4d5e6f7g8h9j0k1m2",
"request_id": "req_01k1a2b3c4d5e6f7g8h9j0k1m2"
}Required scope:
orders:write.
Read the workflow guide for setup, examples, and recovery behavior.
Authorizations
OAuth 2.0 client credentials.
Headers
A 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]+$File to delete from this order. Stable identifier for an uploaded or published order file.
Pattern:
^file_[a-z0-9-]+$Response
The file is deleted.
⌘I
Delete a customer upload
curl --request DELETE \
--url https://sandbox.api.bahnexpress.fi/v2/orders/{order_id}/files/{file_id} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://sandbox.api.bahnexpress.fi/v2/orders/{order_id}/files/{file_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sandbox.api.bahnexpress.fi/v2/orders/{order_id}/files/{file_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text){
"type": "https://api.bahnexpress.fi/problems/authentication-failed",
"title": "The access token is not valid.",
"status": 401,
"code": "authentication_failed",
"instance": "/v2/orders/ord_01k1a2b3c4d5e6f7g8h9j0k1m2/files/file_01k1a2b3c4d5e6f7g8h9j0k1m2",
"request_id": "req_01k1a2b3c4d5e6f7g8h9j0k1m2"
}{
"type": "https://api.bahnexpress.fi/problems/permission-denied",
"title": "The access token does not have the required scope.",
"status": 403,
"code": "permission_denied",
"instance": "/v2/orders/ord_01k1a2b3c4d5e6f7g8h9j0k1m2/files/file_01k1a2b3c4d5e6f7g8h9j0k1m2",
"request_id": "req_01k1a2b3c4d5e6f7g8h9j0k1m2",
"detail": "The orders:write scope is required."
}{
"type": "https://api.bahnexpress.fi/problems/resource-not-found",
"title": "The file could not be deleted.",
"status": 404,
"code": "resource_not_found",
"instance": "/v2/orders/ord_01k1a2b3c4d5e6f7g8h9j0k1m2/files/file_01k1a2b3c4d5e6f7g8h9j0k1m2",
"request_id": "req_01k1a2b3c4d5e6f7g8h9j0k1m2",
"detail": "The file does not exist."
}{
"type": "https://api.bahnexpress.fi/problems/order-not-updateable",
"title": "The file could not be deleted.",
"status": 409,
"code": "order_not_updateable",
"instance": "/v2/orders/ord_01k1a2b3c4d5e6f7g8h9j0k1m2/files/file_01k1a2b3c4d5e6f7g8h9j0k1m2",
"request_id": "req_01k1a2b3c4d5e6f7g8h9j0k1m2",
"detail": "This order can no longer change."
}{
"type": "https://api.bahnexpress.fi/problems/internal-error",
"title": "The server could not complete the request.",
"status": 500,
"code": "internal_error",
"instance": "/v2/orders/ord_01k1a2b3c4d5e6f7g8h9j0k1m2/files/file_01k1a2b3c4d5e6f7g8h9j0k1m2",
"request_id": "req_01k1a2b3c4d5e6f7g8h9j0k1m2"
}{
"type": "https://api.bahnexpress.fi/problems/internal-error",
"title": "The server could not complete the request in time.",
"status": 503,
"code": "internal_error",
"instance": "/v2/orders/ord_01k1a2b3c4d5e6f7g8h9j0k1m2/files/file_01k1a2b3c4d5e6f7g8h9j0k1m2",
"request_id": "req_01k1a2b3c4d5e6f7g8h9j0k1m2"
}