Skip to content

Preview Run night audit (dry-run)

POST
/v1/actions/hospitality.action.run_night_audit/preview
curl --request POST \
--url https://api.aerandil.com/v1/actions/hospitality.action.run_night_audit/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "branch": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "params": { "accrue_commission": true, "balance_packages": true, "business_date": "2026-04-15", "enforce_deposits": true, "expire_waitlist": true, "open_next": true, "post_no_show_fees": true, "post_room_and_tax": true, "release_block_cutoffs": true, "retire_expired_cards": true, "strip_visitor_keys": true, "sweep_no_shows": true }, "return_modified": false, "target": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "object_type": "hospitality.property" } }'

Scenario preview of apply_hospitality_action_run_night_audit — runs the action exactly as apply would (validation, handler dispatch, modified-object projection, commit-time cross-link validation) then rolls the transaction back. Returns the modified_objects / modified_links / warnings the apply would have produced without persisting anything or firing any outward effect. Requires the same actions:hospitality.action.run_night_audit:apply scope as apply. No Idempotency-Key.

Media typeapplication/json
object
branch

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).

string format: uuid
params
required
object
accrue_commission
Accrue travel-agent and channel commission on stays that completed today (defaults to true)
boolean
balance_packages
Settle unconsumed package allowances due on the closing date as profit (defaults to true)
boolean
business_date
required
Business date
string format: date
enforce_deposits
Cancel expired courtesy holds and lapsed wholly-unpaid deposits whose frozen policy says auto-cancel; record other lapses for the operator (defaults to true)
boolean
expire_waitlist
Age out waitlist entries two business days past their requested departure (defaults to true)
boolean
open_next
Open the next business date after closing this one (defaults to true)
boolean
post_no_show_fees
Assess and post the cancellation policy's no-show fee for reservations swept to no_show (defaults to FALSE — posting revenue to no-shows is a policy decision, not a default)
boolean
post_room_and_tax
Post the night's room charges to in-house folios (defaults to true)
boolean
release_block_cutoffs
Release group-block rooms nobody picked up, per each block's cutoff mode (defaults to true)
boolean
retire_expired_cards
Mark cards on file whose expiry month has passed as `expired`, so nothing offers a guarantee the issuer will decline (defaults to true)
boolean
strip_visitor_keys
Strip the visitor key from offers, turnaways and reservations whose arrival night is past the property's grace (defaults to true)
boolean
sweep_no_shows
Sweep unresolved arrivals to no_show (defaults to true)
boolean
return_modified

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.

boolean
target
required
object
id
required
string format: uuid
object_type
required
Allowed value: hospitality.property

Preview computed and rolled back. modified_objects and modified_links carry the effect set the apply would produce; preview is always true.

Media typeapplication/json
ApplyActionResponse

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
correlation_id
required

Per-invocation correlation id; matches events.correlation_id for every event this action appended.

string format: uuid
modified_links
required

Links established or removed by this invocation. Empty when the caller did not request return_modified.

Array<object>
object
from_id
required
string format: uuid
from_type
required
string
kind
required
Allowed values: linked unlinked end_dated
link_type
required
Allowed values: hospitality.link.commission_detail_for_reservation hospitality.link.commission_detail_owed_to_company hospitality.link.commission_detail_owed_to_channel hospitality.link.folio_has_charge hospitality.link.charge_at_outlet hospitality.link.reservation_has_folio hospitality.link.charge_has_tax_application hospitality.link.package_sale_has_consumption hospitality.link.consumption_for_charge hospitality.link.charge_attributed_to_package_sale hospitality.link.charge_attributed_to_package_component hospitality.link.reservation_in_share_group hospitality.link.charge_for_service_item hospitality.link.folio_has_payment
to_id
required
string format: uuid
to_type
required
string
modified_objects
required

Objects created, modified, or soft-deleted by this invocation. Empty when the caller did not request return_modified.

Array<object>
object
id
required
string format: uuid
kind
required
Allowed values: modified created
object_type
required
Allowed values: hospitality.property hospitality.block_allocation hospitality.waitlist_entry hospitality.payment_request hospitality.stay_offer hospitality.turnaway hospitality.payment_card hospitality.commission_detail hospitality.night_audit_run hospitality.business_date hospitality.reservation hospitality.reservation_room hospitality.availability_day hospitality.charge hospitality.folio hospitality.tax_application hospitality.package_component_consumption hospitality.room_status_block hospitality.room hospitality.share_group hospitality.payment
warnings

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.

Array<object>
object
message
required

Human-readable summary, suitable for logging or operator-UI surfacing.

string
object_type
required

Object type the warning was raised against.

string
property

Property the warning anchors to, when a single field is the locus. Absent for multi-field rules.

string
rule
required

Stable kebab-case rule identifier (e.g. comp-authority-over-limit).

string
Example
{
"modified_links": [
{
"kind": "linked",
"link_type": "hospitality.link.commission_detail_for_reservation"
}
],
"modified_objects": [
{
"kind": "modified",
"object_type": "hospitality.property"
}
]
}
Cache-Control
string
Allowed value: no-store

Always no-store — uncommitted live data.

Conflict — concurrent modification or unique constraint violation the apply would hit.

Validation error — the apply would be rejected.