Cancel a scheduled departure (CancelDeparture)
POST/departures/:departureId/cancellations
Moves a SCHEDULED departure to CANCELLED and publishes DepartureCancelled, which delivery-promise and order-sourcing use to re-promise. Every assignment booked on the departure is rebooked onto the next departure from the same origin (BookingMoved) or reported as BookingFailed when none fits. Cancel before cutoffAt wherever possible. Cancelling a CANCELLED departure returns it unchanged.
Request
Responses
- 200
- 400
- 404
- 409
- 413
- 422
- 500
Departure cancelled (or already cancelled).
Response Headers
Present, with the value true, only on a response replayed from a stored first answer (a 2xx or a refusal that is final for the request; a 5xx and a refusal that depends on state another request can change are never stored).
Malformed request. Types: malformed-request (bad JSON, unknown field, NUL character), idempotency-key-required, idempotency-key-invalid, invalid-limit, invalid-cursor and unknown-query-parameter.
Unknown id (problem type not-found), or a NUL character in the request path (problem type resource-not-found).
State or capacity conflict, or Idempotency-Key reuse. Types: idempotency-key-reused (the key was already used with a different request), departure-full (ErrDepartureFull), departure-closed (ErrDepartureClosed), lane-closed (ErrLaneClosed), package-already-loaded (ErrPackageAlreadyLoaded), load-over-capacity (ErrLoadOverCapacity), load-already-exists (ErrLoadAlreadyExists), illegal-transition and concurrent-update.
Request body above 64 KiB (problem type request-body-too-large).
Validation failure. Types: overlapping-slots (ErrOverlappingSlots), invalid-departure-times (ErrInvalidDepartureTimes) and validation-failed. An empty request body is decoded as all-zero values and fails here (validation-failed), not as a 400.
Unexpected failure (problem type internal-error); the detail never carries the internal message. A 5xx is never stored by the Idempotency-Key middleware, so the same key can retry.