Cancel an order
Cancel an eligible order using its current revision and a stable write key.
orders:write. The request has no body.
Before you cancel:
- Read the order and check that
allowed_actionscontainscancel. If it does not, showcancellation_unavailable_reason. - Send the current
revisioninside double quotation marks inIf-Match. - Send a new
Idempotency-Key. After a timeout, retry with the same key andIf-Matchvalue.
409 order_not_cancellable with the reason in detail.
A successful cancellation sets the status to cancelled and keeps the order readable. Bahn sends com.bahn.order.cancelled.v1. If the transport was shared with other orders, Bahn arranges their transport separately.
Read Change or cancel an order for an example and the recovery from each error.Headers
Path Parameters
Response
The cancelled order.
Current state of one transport order.
Fields accepted by PATCH at this transport stage. Pickup and delivery entries use dotted paths. Contact entries permit partial name, phone, and email updates. Empty after primary delivery or cancellation. Other validation and credential scopes still apply.
customer_reference, customer_note, file_ids, items, service_options, pickup.address, pickup.type, pickup.available_from, pickup.requested_windows, delivery.address, delivery.type, delivery.requested_windows, pickup.release_code, pickup.contact, delivery.contact Actions that the current order state permits. The list does not check the scopes of your credential. Use this list to enable controls, and handle rejected writes because the order can change before the request completes.
Operation that the current order state permits. It does not check the scopes of your credential.
update, cancel, get_files, get_inspection_report, get_tracking Drivers with a booking on this order, one entry for each driver and vehicle. Drivers who finished their part stay in the list. A booking can cover only part of the route, and it does not start location tracking. Replace the displayed list each time you read the order.
Text that explains why you cannot cancel or change the order, or null when both actions are available. Show the text as written; its wording can change. An order that returns to accepted after a driver unbooks stays closed.