Skip to content

Quote cancellation penalty

POST
/v1/functions/hospitality.function.quote_cancellation_penalty/invoke
curl --request POST \
--url https://api.aerandil.com/v1/functions/hospitality.function.quote_cancellation_penalty/invoke \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "params": { "cancel_at": "2026-04-15T12:00:00Z", "reservation_room_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }, "target": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "object_type": "hospitality.reservation" } }'

Compute the cancellation penalty that would apply if the reservation were cancelled at cancel_at. Walks the bound cancellation_policy tier ladder against the reservation’s arrival and returns the matched tier plus diagnostic context (hours of notice, no-show classification, the policy’s non-refundable flag). Read-only — emits no edits.

Media typeapplication/json
object
params
required
object
cancel_at
required
Hypothetical cancellation time
string format: date-time
reservation_room_id
One room of the booking, to quote its part alone
string format: uuid
target
required
object
id
required
string format: uuid
object_type
required
Allowed value: hospitality.reservation

Function invoked. The body carries the typed return_value shaped by the function’s declared return_type.

Media typeapplication/json
InvokeFunctionResponse

Envelope returned by the Aerandil function engine. correlation_id is the per-invocation id for trace stitching; return_value is the typed value the function computed (shape declared by the function’s return_type).

object
correlation_id
required

Per-invocation correlation id; appears on log/trace records this function emitted.

string format: uuid
return_value
required
object
arrival_date
required
string format: date
cancel_at
required
string format: date-time
currency
required
string format: iso-4217
effective_penalty
object
amount
required
string format: decimal
currency
required
string format: iso-4217
expected_total
object
amount
required
string format: decimal
currency
required
string format: iso-4217
fee_amount
object
amount
required
string format: decimal
currency
required
string format: iso-4217
fee_due_at
string format: date-time
matched_step_index
required
integer
no_show_fee_amount
object
amount
required
string format: decimal
currency
required
string format: iso-4217
penalty_kind
string
Allowed values: absolute percent_of_total n_nights
policy_id
required
string format: uuid
room_penalty
object
amount
required
string format: decimal
currency
required
string format: iso-4217
Example
{
"return_value": {
"penalty_kind": "absolute"
}
}
Cache-Control
string

Always no-store — function results are time-sensitive and never cacheable.

Function or target object not found.

Parameter validation or domain-rule violation.