Skip to content

Read Package sale

GET
/v1/object-types/hospitality.package_sale/objects/{id}
curl --request GET \
--url https://api.aerandil.com/v1/object-types/hospitality.package_sale/objects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>'

Read an existing instance.

A reservation-attached instance of a package. Freezes the package definition at sale time via package_version_snapshot so guests cannot be re-priced when the catalog evolves — the snapshot is the structural snapshot half of the design-spec §B.2 structured-policy + immutable-snapshot pattern. contracted_price is the amount the guest agreed to pay for the wrapper; state tracks the lifecycle from pending through consumed / refunded / cancelled.

id
required
string format: uuid

Object id (UUID v7, server-generated at create time).

branch
string format: uuid

Read through an open branch’s copy-on-first-write overlay view instead of the canonical (main) plane. Does not compose with as_of (422). The branch must exist under the caller’s tenant.

Object found.

Media typeapplication/json
object
created_at
required
string format: date-time
id
required
string format: uuid
object_type
required
Allowed value: hospitality.package_sale
properties
required
object
allowance_drawn_at
When a consumption last drew on the sale
string format: date-time
allowance_draws
Consumptions recorded against the sale

Counts up by one with every consumption written through the package write (a room charge’s allowance, a roster tick-off, an operator’s consume). The write is the sale’s version check: a recorder that weighed what was left of a day’s allowance writes the sale at the version it read before summing the day’s rows, so a concurrent draw on the same sale turns the second into a version conflict instead of two draws on one remainder.

integer
assembled_at
required
When the sale was assembled
string format: date-time
contracted_price
required
Package sale contracted price

Wrapper price at sale time

object
amount
required
string format: decimal
currency
required
string format: iso-4217
id
required
Sale id
string
package_ref
Convenience reference to the parent `package` lineage (proposal 0024)
string format: uuid
package_version_ref
required
Frozen pin to the `package_version` row this sale was priced against (proposal 0024)
string format: uuid
package_version_snapshot
Frozen package version at sale time
state
required
Sale state
string
Allowed values: pending confirmed consumed refunded cancelled
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
Example
{
"object_type": "hospitality.package_sale",
"properties": {
"state": "pending"
},
"scope": {
"level": "tenant"
}
}
ETag
string
/^"\d+"$/

Quoted strong validator (RFC 7232 §2.3) carrying the object’s monotonic version. Informational on the read path — object mutation goes through typed actions on /v1/actions/{action}/apply, not raw CRUD.

No object with that id (or soft-deleted).