Plan hold top-up
const url = 'https://api.aerandil.com/v1/functions/hospitality.function.plan_hold_top_up/invoke';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"params":{"on_demand":true},"target":{"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","object_type":"hospitality.stay"}}'};
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://api.aerandil.com/v1/functions/hospitality.function.plan_hold_top_up/invoke \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "params": { "on_demand": true }, "target": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "object_type": "hospitality.stay" } }'What an in-house stay’s pending card holds cover against its bill, and what the night audit’s top-up would do about it now: held (the stay’s live holds), posted (the balance of the bills they sit on), incidental (the allowance of the incidental-hold rule the booking matches, for the nights still to come — at least one), and OPERA’s top-up, excess = posted − held + incidental. action is top_up (a second hold of amount, by the house’s set_hold_top_up rule above its threshold, or by set_credit_limit_overage = hold once the bill reached what is held), charge (credit_limit_overage = charge and the bill has reached what is held: capture taken from the holds and amount held afresh), refused (refusal: the house’s max_per_stay reached, or the money in more than one currency) or none; reason is the desk’s sentence. Also the rule (policy_code, match_reason), the house’s settings, the stay’s top-ups so far, its last recorded refusal and any attempt the card rail opened and has not recorded. The card rail acts on this after each night audit and on the desk’s Top up now; nothing is held by reading it. Read-only.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
object
object
Responses
Section titled “Responses”Function invoked. The body carries the typed return_value shaped by the function’s declared return_type.
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
Per-invocation correlation id; appears on log/trace records this function emitted.
object
object
object
object
object
object
object
object
Example
{ "return_value": { "action": "none", "credit_limit_overage": "off", "last_refusal": "card_declined", "refusal": "card_declined" }}Headers
Section titled “Headers”Always no-store — function results are time-sensitive and never cacheable.
Function or target object not found.
Parameter validation or domain-rule violation.