Skip to content

Preview invoice

POST
/v1/functions/hospitality.function.preview_invoice/invoke
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.

Media typeapplication/json
object
params
required
object
recipient_kind
Preview billing the guest or the company; omit for the default the action would pick
string
Allowed values: person company
target
required
object
id
required
string format: uuid
object_type
required
Allowed value: hospitality.folio

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
amount_due
object
amount
required
string format: decimal
currency
required
string format: iso-4217
amount_paid
object
amount
required
string format: decimal
currency
required
string format: iso-4217
blockers
required
Array<string>
can_issue
required
boolean
currency
string format: iso-4217
due_on
string format: date
gross_total
object
amount
required
string format: decimal
currency
required
string format: iso-4217
issuer
kind
string
lines
net_total
object
amount
required
string format: decimal
currency
required
string format: iso-4217
recipient
recipient_id
string
recipient_kind
string
seals_folio
boolean
simplified
boolean
supply_from
string format: date
supply_to
string format: date
tax_summary
tax_total
object
amount
required
string format: decimal
currency
required
string format: iso-4217
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"
}
}
}
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.