Cancellation rate by distribution channel
const url = 'https://api.aerandil.com/v1/reports/cancel_rate_by_channel';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.aerandil.com/v1/reports/cancel_rate_by_channel \ --header 'Authorization: Bearer <token>'Cancellation rate per (property, distribution channel) over a business-day window: bookings, cancellations, and the ratio, grouped by the reservation source enum.
Interim surface. A hand-authored read over the cancel_rate_by_channel rollup; the conformed-metric (MetricDef) layer later supersedes it, adding the staleness tiers.
Scope: objects:read (the data derives from reservations). Live data: always Cache-Control: no-store.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Narrow to one property; else all of the tenant’s properties.
Inclusive lower bound on period_start, YYYY-MM-DD.
Inclusive upper bound on period_start, YYYY-MM-DD.
Responses
Section titled “Responses”The cancel-rate rows plus a computed-at meta block.
object
object
Newest row’s compute timestamp, or null when there are no rows.
object
cancellations / bookings, or null when bookings == 0 — never NaN.
Distribution channel — the reservation source enum.
Examplegenerated
{ "meta": { "computed_at": "example" }, "report": "example", "rows": [ { "bookings": 1, "cancel_rate": 1, "cancellations": 1, "computed_at": "example", "period_start": "example", "property_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "source": "example" } ]}Headers
Section titled “Headers”Always no-store — live data is never cacheable.
invalid_date — from / to must be YYYY-MM-DD.
Structured error wrapper. Every non-2xx response from any Aerandil endpoint serialises to this shape; the HTTP status carries the failure class (4xx/5xx), the body adds a stable code for programmatic dispatch plus a human-readable message.
object
object
Stable, programmatic error code (e.g. unauthorized, forbidden, not_found, invalid_body, invalid_url, precondition_failed, no_secondary_key). Clients dispatch on code, not on the message (which may be localised or contextualised in future versions).
Request-id correlation handle echoed on the request-id response header — support teams correlate without scraping logs.
Human-readable explanation of the failure.
Per-error structured detail. The shape varies by code (e.g. forbidden_action carries {"action": "..."}; precondition_failed carries {"current_version": N}).
Examplegenerated
{ "error": { "code": "example", "instance_id": "example", "message": "example", "parameters": "example" }}