Set tax rule
const url = 'https://api.aerandil.com/v1/actions/hospitality.action.set_tax_rule/apply';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"branch":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","params":{"adults_only":true,"basis":"percent","bucket":"rooms","code":"example","description":"example","effective_from":"2026-04-15","effective_to":"2026-04-15","flat_amount":{"amount":"example","currency":"example"},"inclusive":true,"jurisdiction":"example","rate":"example","reduced_after_nights":1,"reduced_value_share":"example","system_charge_kind":"forfeited_deposit","tax_class":"example"},"return_modified":false,"target":{"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","object_type":"hospitality.property"}}'};
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/actions/hospitality.action.set_tax_rule/apply \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "branch": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "params": { "adults_only": true, "basis": "percent", "bucket": "rooms", "code": "example", "description": "example", "effective_from": "2026-04-15", "effective_to": "2026-04-15", "flat_amount": { "amount": "example", "currency": "example" }, "inclusive": true, "jurisdiction": "example", "rate": "example", "reduced_after_nights": 1, "reduced_value_share": "example", "system_charge_kind": "forfeited_deposit", "tax_class": "example" }, "return_modified": false, "target": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "object_type": "hospitality.property" } }'Author one tax rule at the property — the config the night audit derives tax_application lines from. Rules sharing a code form a non-overlapping succession timeline: a call whose effective_from lands after the current open-ended rule end-dates that predecessor at effective_from − 1 day and mints the successor (the Mews validity-interval model — a rate change is never an in-place edit of history); a call repeating an existing rule’s (code, effective_from) replaces that row in place (converging replay / mis-key correction); a call dated before an existing later rule for the same code refuses — successions are authored forward. basis decides the shape: percent requires rate (in [0, 1]) and forbids flat_amount; flat_per_night and per_person_per_night require flat_amount and forbid rate. inclusive decides whether the tax lives inside the posted amount (VAT carve-out) or on top of it (US-style add-on). The rule targets exactly one of bucket, system_charge_kind or tax_class (the VAT class an F&B item class names — a percent rule; the till rings every rule in force for a line’s class): a forfeited deposit, cancellation fee or no-show charge is taxed only by a percent, inclusive rule targeting its kind, so a house in a jurisdiction that taxes retained payments (the UK) authors them and one that does not (Austria) authors none. The succession timeline is per (code, target), so one VAT code can cover rooms and the retained payments alike. reduced_after_nights + reduced_value_share on a percent rooms rule is the UK 28-day rule. The emitted authoring event is the permanent who-changed-what-tax-when trail.
Effects: create hospitality.tax_rule; modify hospitality.tax_rule; link hospitality.link.tax_rule_at_property.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Apply against an open branch’s overlay view instead of the canonical (main) plane. The action’s writes land in the branch’s copy-on-first-write overlay, its events in the branch’s own stream, and the invocation is journaled for merge-by-replay. Branch writes are action-only, so this is the write-side entry point to a branch (POST /v1/branches forks one).
object
object
When true, the response carries modified_objects and modified_links projections — the engine reads the event log inside the same transaction so the projection observes the handler’s own writes.
object
Responses
Section titled “Responses”Action applied. modified_objects and modified_links populated when return_modified: true was supplied.
Envelope returned by the Aerandil action engine. correlation_id ties every event emitted by this invocation; modified_objects and modified_links project the events the handler emitted (per the action’s declared effects); warnings carries any non-blocking soft-validator observations.
object
Per-invocation correlation id; matches events.correlation_id for every event this action appended.
Links established or removed by this invocation. Empty when the caller did not request return_modified.
object
Objects created, modified, or soft-deleted by this invocation. Empty when the caller did not request return_modified.
object
Non-blocking soft-validator observations emitted during this invocation (e.g. comp-authority over-limit, recipe pour-cost over sell-price). Absent when no warnings were emitted.
object
Human-readable summary, suitable for logging or operator-UI surfacing.
Object type the warning was raised against.
Property the warning anchors to, when a single field is the locus. Absent for multi-field rules.
Stable kebab-case rule identifier (e.g. comp-authority-over-limit).
Example
{ "modified_links": [ { "kind": "linked", "link_type": "hospitality.link.tax_rule_at_property" } ], "modified_objects": [ { "kind": "created", "object_type": "hospitality.tax_rule" } ]}Conflict — concurrent modification or unique constraint violation.
Validation error — parameter validation or business-rule violation.