Preview invoice
const url = 'https://api.aerandil.com/v1/functions/hospitality.function.preview_invoice/invoke';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"params":{"recipient_kind":"person"},"target":{"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","object_type":"hospitality.folio"}}'};
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.preview_invoice/invoke \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "params": { "recipient_kind": "person" }, "target": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "object_type": "hospitality.folio" } }'Dry-run issue_invoice against a folio: whether it can be issued, what the document would say, and if not, why not — the INVOICE_BLOCKERS vocabulary, all of them at once rather than one refusal at a time. Runs the identical decision the action runs, so the two can never disagree about what is wrong. Read-only, and critically it allocates no number: a preview must not consume a value from a series that has to stay dense.
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
Examplegenerated
{ "correlation_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "return_value": { "amount_due": { "amount": "example", "currency": "example" }, "amount_paid": { "amount": "example", "currency": "example" }, "blockers": [ "example" ], "can_issue": true, "currency": "example", "due_on": "2026-04-15", "gross_total": { "amount": "example", "currency": "example" }, "issuer": "example", "kind": "example", "lines": "example", "net_total": { "amount": "example", "currency": "example" }, "recipient": "example", "recipient_id": "example", "recipient_kind": "example", "seals_folio": true, "simplified": true, "supply_from": "2026-04-15", "supply_to": "2026-04-15", "tax_summary": "example", "tax_total": { "amount": "example", "currency": "example" } }}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.