Cancel a whole departure and fully refund every active booking on it
const url = 'https://quikstik-core.fly.dev/departure-cancellations';const options = { method: 'POST', headers: { 'x-tenant-id': '2489E9AD-2EE2-8E00-8EC9-32D5F69181C0', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"departure_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","effective_date":{"year":1,"month":1,"day":1}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://quikstik-core.fly.dev/departure-cancellations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'x-tenant-id: 2489E9AD-2EE2-8E00-8EC9-32D5F69181C0' \ --data '{ "departure_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "effective_date": { "year": 1, "month": 1, "day": 1 } }'Operator cancellation of a departure (weather, mechanical, too few guests). Runs the
trip-cancel cascade as one resumable unit: enumerate every active booking on the
departure, mark each cancelled and enqueue a full refund (cancellation.requested, the
trip never happened — the time-to-departure schedule is not consulted), then mark the
departure cancelled. The ledger settles the refunds asynchronously. The cascade
is idempotent and resumable — each refund carries a stable key derived from its booking id
and only active bookings are enumerated, so a re-run after a partial failure completes the
rest and double-refunds nothing; no Idempotency-Key is required. Fail-closed: 503 when
no backend is wired. The response reports how many bookings were cancelled.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Tenant identifier (UUID).
Authn/authz semantics are intentionally TBD for this contract slice; this header exists to keep the contract explicitly multi-tenant from day 0.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The departure being cancelled (every active booking on it is refunded).
Business/effective date of the cancellation, for period close.
object
Example generated
{ "departure_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "effective_date": { "year": 1, "month": 1, "day": 1 }}Responses
Section titled “Responses”Departure cancellation accepted; active bookings cancelled and refunds enqueued
object
How many active bookings the cascade cancelled and refund-requested.
Example
{ "status": "cancelled"}Missing or invalid session bearer token
object
Stable, machine-readable reason code (e.g. “sold_out”, “processor_not_configured”, “rail_refused”).
Example
{ "reason": "sold_out"}The session’s effect authority does not cover this operation
object
Stable, machine-readable reason code (e.g. “sold_out”, “processor_not_configured”, “rail_refused”).
Example
{ "reason": "sold_out"}No durable backend is wired for this operation (fail-closed)
object
Stable, machine-readable reason code (e.g. “sold_out”, “processor_not_configured”, “rail_refused”).
Example
{ "reason": "sold_out"}