Skip to content

Search Invoice

POST
/v1/object-types/hospitality.invoice/search
curl --request POST \
--url https://api.aerandil.com/v1/object-types/hospitality.invoice/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "branch": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "cursor": "example", "filters": [ { "property": "number", "type": "eq", "value": "example" } ], "limit": 1, "order": "asc", "property_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "scope": { "level": "tenant" }, "sort_by": "created_at" }'

Search for instances. Filters eq, contains, gte and lte AND-compose; or / not are additive follow-ups. Pages with an opaque cursor; the +1 fetch returns has_more without a second round-trip. Ordered by sort_by (default created_at) in order (default ascending), id breaking ties; rows with no value for a property key sort last.

The numbered, sealed document a folio becomes when it is issued — a tax invoice, or a credit note reversing one. Carries snapshots of the issuer, the recipient, every ledger line and the per-rate tax bands, so the document renders from itself and never changes after issue.

Media typeapplication/json
object
branch

Optional open-branch id. Search composes that branch’s copy-on-first-write overlay instead of main, so a preview reads its own hypothetical writes. Omit to read main.

string format: uuid
cursor

Opaque cursor from a prior response’s next_cursor. Pass back verbatim; do not introspect.

string
filters

Conjunctive list of predicates. Empty or omitted matches every row in scope, capped by limit.

Array
One of:
object
property
required
Allowed value: number
type
required
Allowed value: eq
value
required
string
limit

Page size. Server defaults to 50, silently clamps at 500 (AIP-158 §3).

integer
>= 1 <= 500
order

Direction of sort_by: asc (oldest / smallest first) or desc. A cursor is bound to the sort_by and order it was minted under; another pair is refused (422).

string
default: asc
Allowed values: asc desc
property_id

The house a desk stands in: keeps this property’s rows (property- or venue-scoped there) and every row scoped to no property (tenant, brand, portfolio), and drops a sibling house’s — the meaning property_id has on the event tail.

string format: uuid
scope
One of: discriminator: level
object
level
required
string
Allowed value: tenant
Allowed values: tenant
sort_by

What the page is ordered by: the row’s created_at or updated_at, or a property whose type orders — strings, enums and dates as text, ints, decimals and durations as numbers, datetimes as instants. Rows with no value sort last in either direction. A property the caller is not cleared to read is refused (403).

string
default: created_at
Allowed values: created_at updated_at number kind series sequence_value issued_on issued_at supply_from supply_to due_on recipient_kind language content_hash previous_hash render_version note

Search results, ordered by (sort_by, id) in the requested order (ascending by default).

Media typeapplication/json
object
data
required
Array<object>
object
created_at
required
string format: date-time
id
required
string format: uuid
object_type
required
Allowed value: hospitality.invoice
properties
required
object
amount_due
required
Invoice amount due

Zero on a settled stay; the transferred balance on a folio settled to a company’s A/R account.

object
amount
required
string format: decimal
currency
required
string format: iso-4217
amount_paid
required
Invoice amount paid

Amount paid

object
amount
required
string format: decimal
currency
required
string format: iso-4217
content_hash
required
Content hash

SHA-256 over the canonical snapshot. With previous_hash this chains issued documents, which is what the modern fiscal regimes actually check — they put integrity on a chain over issued records rather than on the integer being dense.

string
currency
required
Currency
string format: iso-4217
due_on
Payment due

Only set when amount_due is above zero — the company-billed case.

string format: date
gross_total
required
Invoice gross total

Gross total

object
amount
required
string format: decimal
currency
required
string format: iso-4217
issued_at
required
Issued at

The instant of issue. Also the renderer’s fixed timestamp, which is what makes a re-render byte-identical to the stored PDF.

string format: date-time
issued_on
required
Issue date

The property’s business date of issue — an action parameter, never Utc::now(). This is the document’s date for tax purposes.

string format: date
issuer
required
Invoice issuer

The property’s legal identity, as it printed.

object
address
required
object
city
required
string
country
required
string
line1
required
string
line2
string
postal_code
string
region
string
bank_account
object
account_name
string
account_number
string
bic
string
iban
string
sort_code
string
company_registration_number
string
contact_email
string
contact_phone
string
legal_name
required
string
tax_registration_number
string
tax_registration_scheme
required
string
kind
required
Document kind

invoice, or credit_note reversing one.

string
Allowed values: invoice credit_note
language
required
Language

BCP 47 tag the document was rendered in.

string
lines
required
Invoice lines

The printed lines, snapshotted at issue.

Array<object>
object
bucket
string
business_day
required
string format: date
description
required
string
gross
required
object
amount
required
string format: decimal
currency
required
string format: iso-4217
net
required
object
amount
required
string format: decimal
currency
required
string format: iso-4217
tax
required
object
amount
required
string format: decimal
currency
required
string format: iso-4217
net_total
required
Invoice net total

Net total

object
amount
required
string format: decimal
currency
required
string format: iso-4217
note
Note
string
number
required
Invoice number

The legal document number, e.g. STAN-2026-000123. Allocated from the property’s series inside the issuing transaction and never reissued.

string
previous_hash
Previous content hash

The previous issued document’s content_hash — one chain per property, spanning invoices AND credit notes together, absent only for the property’s first. Deliberately NOT per series: Spain’s Orden HAC/1177/2024 art. 7(c) requires a system to produce “una unica cadena”, and art. 7(d) that the chain carry both the alta and the anulacion records; Basque TicketBAI chains to the previous issued invoice regardless of series. The number series stays per kind; the chain is one strand. Backwards here makes Veri-factu a rebuild rather than a configuration.

string
recipient
Invoice recipient

Who the document was addressed to, as it printed.

object
address
object
city
required
string
country
required
string
line1
required
string
line2
string
postal_code
string
region
string
company_name
string
email
string
kind
required
string
name
required
string
reference
string
tax_identifier
string
recipient_kind
required
Recipient kind

Unmarked twin of recipient.kind, so the board can filter company documents without reading the PII snapshot.

string
Allowed values: person company
render_version
required
Renderer version

Which renderer produced the stored PDF. A later engine upgrade may change bytes, so a re-render under a different version is a copy, not the original.

string
sequence_value
required
Sequence value

The bare counter value number was rendered from. Kept so a gap in a series is detectable without parsing the formatted number.

integer
series
required
Number series

The sequence this number came from — {property_id}:{kind}:{yyyy}. Series are annual and per document kind: France requires numbering that is chronological and continuous within a series, and a credit note sharing the invoice run cannot satisfy that.

string
simplified
required
Simplified

Issued under the small-amount rule (UK £250, DE €250) without recipient details. Never true for a company recipient — the whole point of their document is input-tax recovery.

boolean
supply_from
Supply from

First day of the period supplied — the stay’s arrival. Printed as the Leistungszeitraum.

string format: date
supply_to
Supply to

Last day of the period supplied — the stay’s departure, which is also the UK basic tax point for a completed stay.

string format: date
tax_summary
required
Invoice tax summary

Per-rate bands, derived from the charges’ own tax_application rows — the rule’s rate, not a recomputation.

Array<object>
object
basis
required
object
amount
required
string format: decimal
currency
required
string format: iso-4217
code
string
inclusive
boolean
jurisdiction
string
name
string
rate
required
string format: decimal
tax
required
object
amount
required
string format: decimal
currency
required
string format: iso-4217
tax_total
required
Invoice tax total

Tax total

object
amount
required
string format: decimal
currency
required
string format: iso-4217
provenance

Per-property source attribution and pins. An entry under properties means the property’s current value came from that source (on the source’s own clock, source_updated_at); an entry under pins is a human override protecting the property from sourced writes.

object
pins
object
key
additional properties
object
pinned_at
string format: date-time
pinned_by
object
reason
required
string
properties
object
key
additional properties
object
external_id
string
recorded_at
required
string format: date-time
source
required
string
source_updated_at
string format: date-time
stream
string
scope
required
One of: discriminator: level
object
level
required
string
Allowed value: tenant
Allowed values: tenant
tenant_id
required
string format: uuid
updated_at
required
string format: date-time
version
required
integer
>= 1
has_more
required
boolean
next_cursor

Cursor for the next page; omitted when the result set is exhausted.

string
Example
{
"data": [
{
"object_type": "hospitality.invoice",
"properties": {
"kind": "invoice",
"recipient_kind": "person"
},
"scope": {
"level": "tenant"
}
}
]
}

Validation error — unknown property or filter type mismatch.