Items and quotas
The offer and the pool of capacity behind it — currency, sale windows, gating, and the rules that freeze once you have sold something
An item is the offer, not the thing. A named, priced, quota-backed thing you sell: "General admission", "Early bird", "VIP". The thing itself — the occasion, its lineup, its artwork — lives in your catalog. Selling the same thing again is reopening the offer's window or minting a second offer.
An item is usually admission to an event, but it does not have to be. Leave event_id out for merchandise — a T-shirt, a programme — and it sells through the same checkout, draws from a quota like any other item, and simply carries no date. Everything else about it is identical.
A quota is a named pool of sellable capacity. Items draw on quotas, an item may draw on several, and one quota may back several items. That last property is the load-bearing one: it is how "300 people fit in the room" survives being sold as four tiers at four prices.
The two are separate because capacity is a fact about the room and price is a fact about the offer, and they change on different clocks.
Items
{
"id": "itm_0199c4e3-77a2-7e19-b0c5-9d3f2a4e6b10",
"event_id": "evt_0199c4e5-2b10-7f44-8a91-3c7d0e5f8a22",
"name": "General admission",
"price_minor": 2500,
"currency": "GBP",
"gated": false,
"active": true,
"sort_order": 0,
"sale_starts_at": null,
"sale_ends_at": null,
"opens_after_item_id": null,
"opens_when": null,
"sale_state": "on_sale",
"sale_opens_at": null,
"sale_opened_by": null,
"quota_ids": ["quo_0199c4e6-3c21-7a55-9b02-4d8e1f6a9b33"],
"requires_approval": false,
"max_per_order": null,
"metadata": {}
}| Field | Notes |
|---|---|
event_id | Optional. The event this item belongs to. Omit it, or send null, for merchandise — something sold through the same checkout that is not tied to a date. |
name | Required. Snapshotted onto each purchased position, so a receipt keeps the name it was sold under. |
price_minor | Required, integer minor units, may be 0. |
currency | Required, on the item — not on the event. Three uppercase letters; send a valid ISO-4217 code. |
gated | Optional, default false. A gated item is unpurchasable without an unlock — see member-gated items. |
active | Optional, default true. false takes it out of sale at once. |
sort_order | Optional, default 0. Yours to use for display ordering; the engine only stores it. |
sale_starts_at / sale_ends_at | Optional, nullable. Send RFC3339 timestamps with an offset; responses normalize to UTC with milliseconds. null at either end means unbounded on that side. |
opens_after_item_id / opens_when | Optional, nullable, set together or both null. This item also opens when another item of the same event runs out or closes — see opening one ticket type when another runs out. |
sale_state, sale_opens_at, sale_opened_by | Read-only, derived. Whether the item can be sold right now, when its sale opened or will, and what opened it. Send none of them; they are what a surface should read instead of comparing the dates with the clock. |
quota_ids | Required, at least one. The pools this item draws on. |
requires_approval | Optional, default false. An approval-gated item is requested through its waitlist and sold only when you approve the request — see approval-gated items. |
max_per_order | Optional, nullable, 1–100. The most units of this item one checkout session may hold; more answers quantity_limit_exceeded. null leaves only the line ceiling of 100. |
metadata | Yours, opaque, echoed everywhere and never read by us. |
Currency lives here
Currency is an item attribute, so one event can carry items priced in different
currencies. What is single-currency is the cart: every line in one quote,
one checkout and one order must share a currency, and mixing them answers
currency_mismatch. The engine performs no FX, ever.
Sale windows are enforced by the engine
sale_starts_at and sale_ends_at are not decoration for your UI: the engine
evaluates them. Outside the window an item is not sellable, and a quote marks
the line:
{
"item_id": "itm_0199c4e3-77a2-7e19-b0c5-9d3f2a4e6b10",
"unit_price_minor": 2500,
"sellable": false,
"blocked_reason": "sale_not_started"
}Whether the sale is open is one evaluation inside the engine — the schedule, an
opening trigger, the
end date and active — and the item's read-only sale_state (inactive,
not_started, on_sale or ended) is its answer. Read that, rather than
comparing sale_starts_at with your own clock: a trigger can open an item
before its start date.
blocked_reason is one of sale_not_started, sale_ended, inactive,
gated, approval_required or event_cancelled (the item's event was cancelled
under a policy that stops new sales). A preview quote prices a blocked line anyway — that is exactly how
you render "on sale Friday, £25" or "members only, £20" — and only refuses it
when a real checkout tries to buy it.
The boundaries are precise: an item is sellable from sale_starts_at
inclusive, and stops at sale_ends_at exclusive.
The sale is evaluated when a cart is priced, and again when a checkout
session is created or updated — a line that is outside its window makes that
request fail with item_not_sellable rather than quietly selling. See
checkout for what a session does with it.
Opening one ticket type when another runs out or closes
A sale window answers "when does this open?" with a date. A launch often wants a different answer: General Sale opens when Early Bird sells out, or when it closes, whichever you choose — and on Friday at the latest. That is a setting on the item that opens, not a rule for the whole organizer:
| Field | Notes |
|---|---|
opens_after_item_id | Another item of the same organizer and event. Never the item itself, and never a loop (A opens after B, B after A, or any longer ring). |
opens_when | runs_out: the other item's issued units have reached the size of a quota it draws on. Units in live baskets do not count, so a full checkout does not open anything. closes: the other item's sale_ends_at has passed. either: whichever happens first. |
The item that opens owns the link; the other item does not know it has a
follower. Set both, or send both as null to remove the link.
# 100 Early Bird tickets, closing Friday week...
curl -X POST https://tickets.lissen.com/api/v1/items \
-H "Authorization: Bearer tk_test_..." \
-H "Ticketing-Organizer: org_0199c4e2-1f7a-7c31-8d44-2b9f6a1e05c7" \
-H "Idempotency-Key: 5a1d2c34-8e1b-4f6a-9b7c-0d3e4f5a6b71" \
-H "Content-Type: application/json" \
-d '{
"event_id": "evt_0199c4e5-2b10-7f44-8a91-3c7d0e5f8a22",
"name": "Early Bird",
"price_minor": 1200,
"currency": "GBP",
"sale_ends_at": "2026-10-16T18:00:00Z",
"quota_ids": ["quo_0199c4e6-3c21-7a55-9b02-4d8e1f6a9b33"]
}'
# ...and General Sale, on its own quota, opening when they are gone or closed.
curl -X POST https://tickets.lissen.com/api/v1/items \
-H "Authorization: Bearer tk_test_..." \
-H "Ticketing-Organizer: org_0199c4e2-1f7a-7c31-8d44-2b9f6a1e05c7" \
-H "Idempotency-Key: 8b3e4d56-0a2c-4c7d-8e9f-1a2b3c4d5e6f" \
-H "Content-Type: application/json" \
-d '{
"event_id": "evt_0199c4e5-2b10-7f44-8a91-3c7d0e5f8a22",
"name": "General Sale",
"price_minor": 1800,
"currency": "GBP",
"opens_after_item_id": "itm_0199c4e3-77a2-7e19-b0c5-9d3f2a4e6b10",
"opens_when": "either",
"quota_ids": ["quo_0199c4ec-9c87-7a11-b168-0d4e7f2a5b99"]
}'Until one of those happens the General Sale item reads
sale_state: "not_started" (with sale_opens_at: null while it waits on a
sell-out alone, or the other item's end date when closes can name one). When
it opens, sale_state becomes on_sale, sale_opened_by is "trigger", and
an item.updated activity is published for it.
What combines with what
- A start date and a trigger. Either can open the item first. General Sale
starts Friday, but Early Bird sells out on Tuesday: General Sale opens on
Tuesday.
sale_opened_bysays which it was. - A link and no start date waits for the trigger. A start date and no link is an ordinary scheduled sale. Neither is on sale from the moment it exists, as before.
- The item's own
sale_ends_atis a hard stop. A trigger opens a sale; it never brings back one that has ended (sale_state: "ended",blocked_reason: "sale_ended"). active: falsestill wins, and the item's own quotas still apply: an opened item can be sold out. A trigger moves no inventory between ticket types and creates none; size each item's quota as you always did.- Closed means the sale's end date has passed. An item that is deactivated, or has not started yet, has not closed.
- It latches. Once a trigger has opened an item it stays open. A refund that
gives Early Bird units back, a basket that lapses, or an extended Early Bird
end date does not close General Sale again. Changing
opens_after_item_idoropens_whenstarts the trigger afresh. - Checkouts already in progress are untouched. A binding quote and a checkout holding units keep working; the trigger decides what can be newly quoted, held or requested on a waitlist.
- Early Bird stays visible as sold out. Nothing is hidden or reallocated:
its availability reads
gone, and showing the row sold out beside the now-open General Sale is your page's choice.
A link to an unknown item or another organizer's answers 400
invalid_reference. One to an item of another event, to the item itself, or
that would close a loop answers 400 invalid_request with
param: "opens_after_item_id". Moving an item to another event while other
items open after it is refused the same way.
The tier editors in the Lissen admin and the ticketing admin offer this as
Also opens when: pick "Sells out", "Closes" or "Sells out or closes", then
the other ticket type. The earlier editor setting that opened a tier when
another's sale ended (a "following" tier) is the closes trigger; existing
ones were converted when this shipped and open at the same moment as before.
Member-gated items
gated: true marks an item as unpurchasable unless something grants an
unlock naming it. The gate is the mechanism; who opens it is a separate
question:
- A discount code with
effect_type: "unlock"opens it. An unlock code makes a gated line sellable in quotes and checkout sessions. - Memberships can grant the same unlock without a code, and gated items become "members see a cheaper tier" with no code to distribute. Nothing about the item changes — see memberships.
An anonymous buyer quoting a gated item gets the line back priced, with
sellable: false and blocked_reason: "gated". That is enough to render "£20,
members only" against a real number rather than hiding the tier.
The quote shape also carries an unapplied_effects array — the "you would get
this if…" teasers. Discount codes never populate it: a code either applies or
is rejected. Membership plans use it for generic "join for a benefit" teasers,
so write your renderer to tolerate entries even when an organizer has no active
membership plans.
Create an item
POST/v1/itemscurl -X POST https://tickets.lissen.com/api/v1/items \
-H "Authorization: Bearer tk_test_..." \
-H "Ticketing-Organizer: org_0199c4e2-1f7a-7c31-8d44-2b9f6a1e05c7" \
-H "Idempotency-Key: 1f6c0b58-3d94-4e12-8a77-9c15b4e0d2a6" \
-H "Content-Type: application/json" \
-d '{
"event_id": "evt_0199c4e5-2b10-7f44-8a91-3c7d0e5f8a22",
"name": "Early bird",
"price_minor": 1800,
"currency": "GBP",
"sale_ends_at": "2026-10-31T23:59:59Z",
"sort_order": 1,
"quota_ids": [
"quo_0199c4e6-3c21-7a55-9b02-4d8e1f6a9b33",
"quo_0199c4ec-9c87-7a11-b168-0d4e7f2a5b99"
]
}'Two quotas on one item means the sale draws on both: a purchase takes one unit out of each, and the item is sellable only while every quota it names has room. That is how "50 early birds, and no more than 250 people in the room in total" is expressed — a small early-bird pool plus the shared room pool.
An event_id or a quota_id that does not exist under your organizer answers
400 invalid_reference.
Update an item
PATCH/v1/items/{id} is partial, needs at least
one field, and validates the merged result — patching sale_starts_at
past the existing sale_ends_at fails even though your patch never mentioned
the latter. The id in the path below is the item shown above; substitute your
own.
curl -X PATCH https://tickets.lissen.com/api/v1/items/itm_0199c4e3-77a2-7e19-b0c5-9d3f2a4e6b10 \
-H "Authorization: Bearer tk_test_..." \
-H "Ticketing-Organizer: org_0199c4e2-1f7a-7c31-8d44-2b9f6a1e05c7" \
-H "Content-Type: application/json" \
-d '{ "active": false }'Price, name, currency, windows, gated, active and metadata all stay
mutable for the life of the item. Changing a price never rewrites history: each
purchased position snapshots the price and description it was sold at.
quota_ids is the one field that can freeze. Read on.
Quotas
{
"id": "quo_0199c4e6-3c21-7a55-9b02-4d8e1f6a9b33",
"name": "Room capacity",
"size": 250,
"metadata": {}
}A quota has a name, a size and your metadata. It has no event: quotas are organizer-scoped, and their association with an event is derived through the items that draw on them. That is deliberate — a quota that can be shared across two events (a two-night pass, a festival wristband) would be impossible to model otherwise.
size: null means unlimited
null is not "unset" or "unknown". It is a declaration that this pool has
no ceiling, and the engine treats it as one: a sale against an all-unlimited
footprint takes no capacity lock at all, because there is nothing to contend
over.
That is why the declaration is terminal. Giving an unlimited quota a finite
size afterwards is refused with quota_unlimited_immutable:
{
"error": {
"type": "invalid_request_error",
"code": "quota_unlimited_immutable",
"message": "An unlimited quota cannot be given a finite size; create a new quota instead",
"param": "size",
"request_id": "d2b7f0c4-9a51-4a2f-9c1e-6c4b0a7e12f3"
}
}Widening the other way — a finite quota to null — is always allowed, even
when the quota is completely consumed. Loosening a ceiling can never oversell
anything.
Pick null deliberately, for genuinely uncapped event admission. For a room,
name the number even if the number is large.
Availability is derived, never stored
GET/v1/quotas/{id}/availabilityThe id in the path is the quota you are reading; substitute your own.
curl https://tickets.lissen.com/api/v1/quotas/quo_0199c4e6-3c21-7a55-9b02-4d8e1f6a9b33/availability \
-H "Authorization: Bearer tk_test_..." \
-H "Ticketing-Organizer: org_0199c4e2-1f7a-7c31-8d44-2b9f6a1e05c7"{
"quota_id": "quo_0199c4e6-3c21-7a55-9b02-4d8e1f6a9b33",
"size": 250,
"issued": 214,
"in_baskets": 36,
"available": 0,
"state": "in_baskets"
}issued— live positions drawing on this pool.in_baskets— units claimed by live checkouts.available—size − issued − in_baskets, floored at zero, andnullwhen the quota is unlimited.state— the value to branch on:available,in_basketsorgone.
in_baskets is deliberately a different state from gone: "none left, but
some are in live checkouts" is a true and useful thing to render, because those
baskets may lapse. On an unlimited quota, size and available are both
null and the state is always available.
This read is a display value. It takes no lock, and the number can move between the read and your next request — the binding decision is recomputed inside the purchase itself. Never gate your own sale on it; render it.
Resizing
PATCH/v1/quotas/{id} changes the name, the size or the metadata. A size change is a capacity operation and is evaluated under the same lock a sale takes, so it cannot race a purchase.
Three rules apply:
-
An unlimited quota can never be given a finite size — that is
quota_unlimited_immutable, and it holds no matter how little has been sold. To stop selling on an unlimited pool, close the item instead:active: false, or asale_ends_atin the past. -
A reduction below what is already consumed is refused —
quota_below_consumption, whose message tells you the figures:{ "error": { "type": "invalid_request_error", "code": "quota_below_consumption", "message": "size cannot be reduced below the 250 already consumed (214 issued, 36 in live checkouts)", "param": "size", "request_id": "d2b7f0c4-9a51-4a2f-9c1e-6c4b0a7e12f3" } }Note that consumption counts live checkouts, not just issued tickets: a pool whose baskets are full refuses a reduction that issued tickets alone would have allowed. Retry once those baskets lapse.
-
Shrinking to exactly the consumed figure is allowed. That is the supported way to close a pool: it sells no more and invalidates nothing already sold.
A resize can also answer capacity_locked when it collides with a purchase
touching the same pool. If it does, this resize was not applied and the size
was not written. Retry with a short backoff.
Rebinding an item's quotas
An item's quota_ids are the mapping every capacity derivation reads.
Rebinding them would move live positions and live holds between pools, so:
quota_ids freezes the moment live capacity depends on the item. After
that, a patch that changes them answers item_quotas_locked, naming what it
found:
{
"error": {
"type": "invalid_request_error",
"code": "item_quotas_locked",
"message": "quota_ids cannot change once capacity depends on this item (214 issued positions, 3 live checkouts, 3 live holds on its current quotas)",
"param": "quota_ids",
"request_id": "d2b7f0c4-9a51-4a2f-9c1e-6c4b0a7e12f3"
}
}Three things follow, and the third surprises people:
- Before anything is sold, rebinding is free. Get the mapping right while the item is still cold.
- Resubmitting the same set is always accepted, frozen or not. A patch
that sends
quota_idsunchanged alongside a price change is not a rebinding, and order does not matter. - A live checkout on a shared quota can freeze an item that nobody is buying. If two items draw on one pool, a basket holding units of that pool makes both items' mappings immutable for as long as it lives. The engine cannot always attribute a hold to the item that caused it, and it would rather refuse a config edit you could retry than move committed capacity between pools.
When a mapping is genuinely wrong after sales have started, the way forward is to mint a new item on the quotas you want and close the old item's sale window. The old item keeps its history intact; the new one sells.
Empty is never legal: quota_ids: [] is refused on the create and on a patch,
because an item with no pool has no defined capacity at all.
Errors these resources return
Quota errors
| Code | Status | Type | What it means | What to do |
|---|---|---|---|---|
quota_unlimited_immutable | 400 | invalid_request_error | An unlimited quota (`size: null`) cannot be given a finite size. Unlimited is terminal. | Create a new finite quota and rebind the item to it, if the item has no live capacity yet. |
quota_below_consumption | 400 | invalid_request_error | A quota resize would have put its size below what is already issued plus what live checkouts are holding. | Read the quota's availability and resize to at least `issued + in_baskets`. |
capacity_locked | 409 | invalid_request_error | Another request held the capacity lock for the quotas this one touches, or the lock on the same purchaser's allowance for an event with a per-customer cap, and the wait timed out. This is contention, not a refusal — nobody has taken the tickets. | Retry with a short backoff. A contended purchase deliberately fails fast rather than parking a connection. |
invalid_request | 400 | invalid_request_error | The request body or query failed validation. `param` names the field. | Fix the named field and send the request again. |
not_found | 404 | invalid_request_error | No such object under this organizer. An object belonging to another tenant reads as absent, never as forbidden. | Check the id and the organizer header. |
Item errors
| Code | Status | Type | What it means | What to do |
|---|---|---|---|---|
item_quotas_locked | 400 | invalid_request_error | An item's `quota_ids` cannot change once live capacity depends on the item. | Mint a new item on the quotas you want and close the old item's sale window. |
invalid_sale_window | 400 | invalid_request_error | An item's `sale_starts_at` is not before its `sale_ends_at`. | Order the window correctly, or clear one end of it. |
invalid_reference | 400 | invalid_request_error | The request referenced an id that does not exist under this organizer — an `event_id`, a `quota_id`, an `item_id`, a `plan_id` (when creating a membership benefit), or a customer named by `id` or `external_ref` in a transfer. | Check the id, and check the `Ticketing-Organizer` header names the tenant that owns it. |
invalid_request | 400 | invalid_request_error | The request body or query failed validation. `param` names the field. | Fix the named field and send the request again. |
not_found | 404 | invalid_request_error | No such object under this organizer. An object belonging to another tenant reads as absent, never as forbidden. | Check the id and the organizer header. |
An id that belongs to another tenant reads as not_found — absent, never
forbidden. The full list is the error registry.
An item that is inactive, outside its sale window or gated is refused with
item_not_sellable when a checkout session is created or updated — never when
you configure it, and never on a preview quote, which prices the line and
marks it sellable: false. See checkout.
What emits on the activity stream
Four types, each carrying the complete resource snapshot:
item.created/item.updated— the item snapshot, including itsquota_idsarray, so a feed consumer can maintain the mapping without reading it back.quota.created/quota.updated— the quota snapshot. A resize is the commonquota.updated, andprevious_attributescarries the old size.
Note what is not there: there is no activity for availability changing. Availability is derived, not stored, so there is nothing to record — the facts that move it (a purchase, a hold, a lapse) each emit their own activity. The full type registry lists every type.
Gotchas
- Every item needs at least one quota. There is no "uncapped by omission" —
if you mean uncapped, create a quota with
size: nulland bind it. - Unlimited is terminal. Widening to
nullis free; coming back from it is not possible on that quota. - A shared quota shares its freeze. A live basket on a pool locks the
quota_idsof every item that draws on it, not just the one being bought. in_basketsis based on units in holds whose status islive, not the wall clock. A basket whose time is up still blocks its units until the engine has actually released it. The engine undersells rather than oversells, deliberately.- Availability is a display value. It takes no lock; do not treat it as a reservation.
- Currency is on the item. An event with items in two currencies is legal; a cart mixing them is not.
sort_ordermeans nothing to the engine. It is stored and echoed for your UI to sort by.- A patch of
quota_idswith the same ids in a different order is not a rebinding. The set is compared, not the array.