Plans, states and effects
The membership reference — plan fields, the join contract, every state, the effects a member gets, and cancellation
A membership is a recurring subscription on the organizer's connected Stripe
account. The organizer is the merchant of record. The engine stores the
subscription's state and turns an active membership into price effects. When
Stripe reports a membership invoice paid, the engine appends a
membership_charge ledger entry for the amount paid and a platform_fee
entry for Lissen's fee, just as it does for ticket sales. A
free plan has no Stripe side at all.
This page is the reference. The walkthrough shows the whole flow once, with Halfmoon Presents and their £10-a-month club.
Create a plan
Plans are organizer-scoped. Creating a paid one creates a Stripe Product and
recurring Price on the organizer's connected account, then stores their
references in the engine; a free plan creates nothing in Stripe.
Either kind also registers the in-engine membership entitlement provider for
that organizer: creating the first plan is the consent act that lets quotes
evaluate membership effects.
curl -X POST https://tickets.lissen.com/api/v1/membership_plans \
-H 'Authorization: Bearer tk_test_…' \
-H 'Ticketing-Organizer: org_…' \
-H 'Idempotency-Key: 8d7f1c2e-…' \
-H 'Content-Type: application/json' \
-d '{
"name": "Halfmoon Club",
"currency": "GBP",
"price_minor": 1000,
"interval": "month",
"percent_off_bps": 2000,
"unlocks_gated_items": true,
"active": true
}'name, active, percent_off_bps, unlocks_gated_items,
required_plan_id,
exclusive_group,
grace_days, the
enrollment settings (enrollment_open,
member_cap) and a free plan's attendance_rule can
be changed with POST /v1/membership_plans/{id}. The currency and interval
never change. The price changes with its own call, for new joins and existing
members alike: see Change the price.
The membership platform fee is the percentage from the organizer's active fee
schedule for the plan currency. A missing schedule fails with
fee_schedule_not_found; it is never treated as a zero fee. Membership v1
uses the percentage component only. A schedule's flat amount and fee mode do
not become recurring Stripe invoice charges.
Plan edits change the engine's offer and effect configuration only. They do not rename, deactivate, or otherwise synchronize the existing Stripe Product or Price. Only a price change creates anything in Stripe.
Change the price
POST/v1/membership_plans/{id}/pricecurl -X POST https://tickets.lissen.com/api/v1/membership_plans/mpl_0199c4f0-1a2b-7c3d-8e4f-5a6b7c8d9e01/price \
-H 'Authorization: Bearer tk_test_…' \
-H 'Ticketing-Organizer: org_…' \
-H 'Idempotency-Key: 5b8e3f1c-…' \
-H 'Content-Type: application/json' \
-d '{ "price_minor": 1200 }'Changes a paid plan's price for new joins and for every existing member, from
each member's next renewal. The body takes price_minor only, above 0; any
other field, a currency or an interval included, answers 400
invalid_request. It needs an Idempotency-Key and organizer administrator
authority (organizer_admin_required otherwise), and answers 200 with the
plan.
- The plan. Its id, benefits, group, cap, grace and every other setting stay
as they are. A new Stripe Price is created on the plan's Product in the plan's
currency and interval, with the same tax behaviour as its current Price (a
tax-inclusive plan stays tax-inclusive, and one created without tax stays
without, whatever membership tax is now). The plan points at it, so
joins from now on are charged it, and
membership_plan.updatedis recorded. A retry with the same key replays the answer and creates no second Price. Sending the plan's current price changes nothing and records nothing. - The members. Every live membership of the plan (
incomplete,active,past_due, including one scheduled to cancel) is moved to the new Price in the background, within minutes for most plans, the soonest renewals first. Apausedmembership is moved when it resumes. Nothing is charged or prorated at the switch; the member's next renewal after the move charges the new price. A renewal that Stripe bills before its member has been moved still charges the previous price, once, so call it ahead of renewals you want at the new price. Each move recordsmembership.updatedwith the membership's newprice_minorand itsprice_applies_at. A move the payment provider refuses is retried, and a membership whose subscription has already ended is left for its ownmembership.canceled. - When it applies. There is no effective date: call it on the day you told your members. To keep existing members on their price, create a new plan instead.
| The member is | Their next charge |
|---|---|
active | The new price at current_period_end, the renewal after the call. |
active, scheduled to cancel | Nothing, unless the cancellation is undone; then the new price at renewal. |
past_due | The open invoice keeps its amount (an issued invoice cannot change); the renewal after it charges the new price. |
paused | The new price when they resume, less the pause credit. Until then price_minor is the previous price and price_applies_at is null; the resume moves them and sets both. |
incomplete | The first invoice keeps its amount; their first renewal charges the new price. A join already under way when the price changed is moved like this one. |
| Waiting for a first charge date | The new price on that date: nothing was invoiced yet. price_applies_at is the date, the same as next_charge_at. |
| Next charge moved to a date | The new price on that date, which stays as it is. price_applies_at is the date, the same as next_charge_at, also when the date is moved after the member was moved. |
| Charged now | The price of the Price they are on when the charge is made. Charged now after being moved, they pay the new price then and price_applies_at is that charge; moved after the charge, from the next renewal. |
A free plan answers 422 membership_plan_free. A plan without a connected
Stripe Price answers 422 payment_intent_unavailable.
Join and confirm
Joining is keyed and attested by the partner. There are no anonymous
memberships. Send exactly one of customer.id or customer.external_ref, plus
the buyer's email and optional name:
{
"plan_id": "mpl_…",
"customer": {
"external_ref": "partner-user-123",
"email": "buyer@example.com",
"name": "A. Buyer"
}
}When the organizer charges tax on memberships, a paid join also says
where the buyer is: customer.address with a two-letter country (and the
postal_code where Stripe Tax needs one), or the ip_address they joined
from.
For a paid plan, POST /v1/memberships returns the incomplete membership and three credentials:
payment_intent_client_secret, connected_account_id and publishable_key.
Use them exactly like buyer checkout credentials: initialise Stripe.js for the
connected account, mount a Payment Element with the client secret, and call
confirmPayment({redirect: "if_required"}) in the buyer's page. Do not mark the
member active from the HTTP 201 response. Poll GET /v1/memberships/{id} until
the webhook-driven state is active.
When Lissen collects an organizer's memberships on its own Stripe account,
connected_account_id is null: initialise Stripe.js with the publishable
key alone, without stripeAccount. The same holds for setup and for a
resume's payment. A membership keeps the account it joined on for its
renewals, card updates, pauses and cancellation, whatever the organizer
collects on later. A join there cannot name a saved_payment_method: it
answers 422 saved_payment_method_unavailable.
The create call is idempotent. A customer cannot have two non-canceled
memberships for the same plan. A join while an incomplete membership's first
payment is still awaited resumes it: the same membership comes back with fresh
payment credentials and no activity. If Stripe has already expired or canceled
that subscription, the old record is retired as canceled and a new one is
created. An active or past_due membership answers 409
membership_already_exists, as does an incomplete one whose subscription
Stripe has already activated before its webhook arrived; poll the membership
instead of joining again. An incomplete membership whose subscription Stripe
holds as unpaid or paused answers 409 too, and polling will not clear it:
that subscription will not activate by itself, so cancel the membership (or wait
for it to read canceled) before joining again.
To charge a paid plan first on a later date, see Charge first on a later date. To pay with a card already saved on the organizer's Stripe account, see Pay with a card already saved.
Retrying a join whose answer was lost
If a paid join's answer never reached you (a timeout or a lost connection),
make the same join again with the same Idempotency-Key. If the membership
was created, its answer is replayed. If the earlier attempt created its Stripe
subscription but never created the membership, the retry uses that
subscription instead of creating a second one, and answers with the
membership it was made for. With a new key the engine still finds and uses
the earlier attempt's subscription when the customer has paid for a
membership before; otherwise it creates a new one, and the earlier one is
ended unpaid.
If the retry is refused (the plan filled up or was disabled meanwhile, or,
with first_charge_at, its date passed before
the member saved a card), the earlier attempt's subscription is cancelled and
anything Stripe charged on it is refunded in full, platform fee included: the
refund names a canceled membership that was never a member
(refund.created). If no retry ever comes, Lissen ends that subscription
itself soon after Stripe's first event for it, and refunds anything it charged
the same way. A subscription made for a membership that does not exist never
keeps a member's money.
The platform fee percentage is read from the organizer's
fee schedule at join, not at plan creation. A
join with no schedule in the plan's currency answers fee_schedule_not_found. A canceled record does not get revived; joining
again creates a new membership and subscription.
Charge first on a later date
A paid join can give first_charge_at, a timestamp: the member's card is
saved now and nothing is charged until that date. Use it to move members who
already paid elsewhere (an old shop, a previous provider) without charging
them twice: set it to the date their paid time runs out.
{
"plan_id": "mpl_…",
"customer": { "external_ref": "partner-user-123", "email": "buyer@example.com" },
"first_charge_at": "2027-01-15T12:00:00Z"
}- It must be in the future and no more than 730 days away, Stripe's own limit;
otherwise the join answers
400first_charge_at_out_of_rangeand nothing is created. A free plan charges nothing, so a free join that gives it answers400first_charge_at_free_plan. - The response's
paymentisnullandsetupholdssetup_intent_client_secret,connected_account_idandpublishable_key. Initialise Stripe.js for the connected account, mount a Payment Element with that secret and callconfirmSetup({redirect: "if_required"}): the member saves a card instead of paying. A join withoutfirst_charge_atanswers exactly as before, withsetup: null. - A returning member saves their card through the setup step like anyone
else, even when Stripe already holds one for them (their Stripe Customer's
default card): the join answers with
setup, and the membership staysincompleteuntil the member confirms it. A card the member saved for another membership is never kept as payment for this one unless they confirm it here: should Stripe charge it on the date for a join they never finished, Lissen ends the join and refunds that payment in full (refund.created). To skip the setup step, name the saved card withsaved_payment_method: the join is thenactiveat once. - Until the card is saved the membership is
incomplete, gives no member effects and holds its enrollment place and exclusive group like an unpaid join. A join whose card is not saved within about a day (23 hours), or by itsfirst_charge_atif that is sooner, is ended by the engine: it readscanceled, its place and group are free, and its setup secret no longer works. Joining again before then resumes it with the samesetupsecret; joining again with another date (or with none), or after that day, replaces it with a new join and a new secret. - In a capped plan the join's place is reserved for 24 hours.
A card whose saving reaches Lissen only after that must win a place again;
if the plan is full by then, the join is ended (
canceled) and its subscription cancelled. A first payment already taken remains recorded as a membership charge and is refunded in full, platform fee included, by Lissen: arefund.creatednames that charge. - Once the card is saved the membership is
active, withmembership.activated: from then it counts like any active membership, for benefits, exclusive groups, caps and prerequisites. - On the date Stripe charges the plan's full price and renews from there. That
first charge is recorded like a renewal: a
membership charge, the platform fee and, under
membership tax, its tax. If it fails it is a failed renewal: the
membership becomes
past_due, the plan's benefit grace period applies and Stripe retries on its schedule. - A member who cancels before the date keeps the benefits until then and is never charged.
next_charge_aton the membership says when it is next charged:first_charge_atuntil then, then the renewal date.- Once the card is saved the date can still be moved, or the first charge made now: see move or make the next charge.
Move or make the next charge
POST/v1/memberships/{id}/next_chargeSets when an active paid membership is next charged. Use it to line a
member up with the date they paid until on an old shop, or to make a renewal
happen now (see Testing renewals).
The body is { "at": "<timestamp>" } or { "at": "now" }, and the request
requires an Idempotency-Key.
curl -X POST https://tickets.lissen.com/api/v1/memberships/$MEMBERSHIP_ID/next_charge \
-H 'Authorization: Bearer tk_test_…' \
-H 'Ticketing-Organizer: org_…' \
-H 'Idempotency-Key: 7c1d2e3f-…' \
-H 'Content-Type: application/json' \
-d '{ "at": "2027-03-01T12:00:00Z" }'{
"membership": { "status": "active", "next_charge_at": "2027-03-01T12:00:00.000Z", "...": "..." },
"charge_attempt": null
}- A date moves the next charge there, earlier or later. The member keeps
the membership and its benefits until then, and the plan's full price is
charged on the date, renewing monthly (or yearly) from it. Nothing is
prorated: moving the date never credits unused time or charges a
difference. It must be in the future and no more than 730 days away,
Stripe's limit; otherwise
400next_charge_at_out_of_rangeand nothing changes. A member still before their first charge date (card saved) is moved the same way. nowcharges one full period now and starts a fresh period from now. It is recorded as a renewal:membership.renewed, a membership charge, the platform fee and, under membership tax, its tax.charge_attemptsays how it went:{ "outcome": "paid" },failedwith the card'sdecline_code, orrequires_actionwhen the member's bank wants them to authenticate, which cannot happen while they are away.- A failed
nowis a failed renewal, never a change that waits for the payment: the membership becomespast_due, the plan's benefit grace period starts, and Stripe retries on its schedule (a payment that needs authentication is not retried: send the member to the payment-method update). The new period still runs from now. - On a
past_duemembership onlynowis accepted: it pays the open overdue invoice with the member's saved card. No second invoice is created. When it is paid the membership isactiveagain (membership.renewed) and its grace is cleared; a decline leaves itpast_due, Stripe's retries carry on, andcharge_attemptsays why. If Stripe has collected the invoice meanwhile nothing is charged andcharge_attemptisnull. A date is refused with409membership_state_conflict: pay what is overdue first. - Refused with
409membership_state_conflict(detail.operationnext_charge): apausedmembership (resume it instead), one set to cancel at its period end (undo the cancellation first), and anincompleteorcanceledone. A free membership answers422membership_no_billing. One next charge of a membership runs at a time: while another request on it failed midway and is unfinished (for up to 24 hours after its latest attempt), a new one is refused the same way; retry that request with itsIdempotency-Keyfirst. - Reads and activities.
next_charge_atandcurrent_period_endshow the new date, and each move is recorded asmembership.updated. - Retries. The same
Idempotency-Keyreplays the stored answer. A request that failed midway is finished, never repeated, by a retry with the same key: what it does (pay the overdue invoice, charge now, or move the date) is decided by its first attempt, so a retry never charges twice, even when the membership's status changed in between, and a charge now retried hours later still completes. For 24 hours the key belongs to that request: sent with anotheratit answers409idempotency_key_reused, and the first request can still be retried under it. After 24 hours the key is a new request. - Concurrent changes. The answer and the stored membership show Stripe's state when the request completes: a cancellation made while the charge was being moved still reads as set to cancel.
Pay with a card already saved
A paid join can name a Stripe Customer and a card already saved on the organizer's own connected Stripe account, for example by the shop the organizer sold its memberships on before. The member does not enter a card.
{
"plan_id": "mpl_…",
"customer": { "external_ref": "partner-user-123", "email": "buyer@example.com" },
"saved_payment_method": {
"stripe_customer_id": "cus_…",
"stripe_payment_method_id": "pm_…"
}
}- The Customer must exist on the organizer's connected account and not be
deleted, otherwise
400stripe_customer_not_found. The payment method must already be attached to that Customer (a legacycard_…id works too), otherwise400payment_method_not_attached. The engine never attaches a card itself. Nothing is created in either case. - The Customer must not belong to another customer: not to another
customer's membership, not to another customer's
Pay with Lissen wallet, and not by the tags the
engine puts on the Customers it uses. Otherwise the join answers
409stripe_customer_linked, anddetail.customer_idnames that customer. A Customer the engine tagged for another organizer is refused without naming anyone. Emails are never compared. - The engine tags the Customer as its own, as it tags the Customers it creates. Under membership tax it also sets the join's location on it, as for a returning member. The Customer is then the one this customer's later memberships use.
- A free plan charges nothing, so a free join that names one answers
400saved_payment_method_free_plan. - Exclusive groups, prerequisites, enrollment and caps, and tax apply as to any join, and are checked before anything is created in Stripe.
With first_charge_at, the card is the one
charged on the date. The membership is active at once, with
membership.created and membership.activated. payment and setup are
both null, and nothing is charged until the date. From the date it is as for
any first charge date: the full price is charged then, and a decline is a
failed renewal with the plan's grace.
Without a date, the card is charged now:
- Paid: the membership is
activeat once,paymentandsetuparenull, and the payment is recorded when Stripe reports it paid. - The bank asks the member to authenticate: the membership is
incompleteandpaymentholds the payment'spayment_intent_client_secret. Initialise Stripe.js for the connected account and callhandleNextAction({ clientSecret })while the member is on the page. The membership isactiveonce it is paid. Joining again with the same card resumes it with the same secret. - Declined: the join answers
422payment_declined.messageis the card's reason, for the member, anddetail.decline_codeis Stripe's code when it gave one. Nothing is created, in Stripe or the engine, and the answer is stored under theIdempotency-Key. Join again with another card, or withoutsaved_payment_methodso the member enters one.
The card is charged before the join is final. If a concurrent join takes the
last place, the exclusive group or the Stripe Customer in that moment, the
join answers that refusal and the payment is refunded in full, platform fee
included, before its subscription is cancelled (with a first_charge_at
that passed while the join was being made, the first charge is refunded the
same way if Stripe already took it). So the money stays
traceable, the refused join is recorded as a canceled membership that was
never active (membership.created and membership.canceled), with its
membership charge and a refund of all of it
(refund.created, then refund.completed or refund.failed). It holds no
place or group, and it does not link the Stripe Customer to the customer. If
Stripe fails that refund, Lissen's operators are alerted, and you can refund
the charge with POST/v1/refunds.
If a join's answer never reached you (a timeout or a lost connection), make
the same join again with the same Idempotency-Key. If the membership was
created, its answer is replayed. If the earlier attempt created its
subscription but never committed the membership, the engine finds it on the
Customer and uses it instead of charging the card again, even when its
first_charge_at has passed since (the membership is then as Stripe holds
it). This recovery also works with a new key, but a new key for an already
active membership answers 409 membership_already_exists. If the recovered
join is refused, its subscription is cancelled and anything it charged is
refunded, as above.
A card the old shop saved without the member's permission for charges made
while they are away (off-session) may need authentication when it is first
charged. With a date, that charge fails like a renewal: the membership
becomes past_due, with the plan's grace period.
Stripe does not retry a charge that waits for authentication. In Stripe test
mode, replacing the card did not pay that charge either, so the membership
stayed past_due. The member can give another card on the
card update page, but that does not pay the
charge already due.
Tax
Lissen can turn on membership tax for an organizer, once Stripe Tax is set
up on its connected account; the organizer's membership_tax, read with
GET/v1/organizer, says whether it is on. It is off unless Lissen turns it on, and nothing on this
page changes while it is off. When it is on:
- A paid plan created from then on gets a tax-inclusive Stripe Price:
price_minoris what the member pays, tax included. A plan created before keeps its Price, which does not include tax, so a join of it answers422membership_plan_not_tax_inclusivebefore anything is created in Stripe: create a new plan at the same price and offer that one. A price change keeps a Price's tax behaviour, so it does not make such a plan tax-inclusive. - Each paid join's subscription is created with Stripe Tax, which taxes every
invoice (the first, renewals, a resume's restart) where the buyer is. A join
charged first on a later date still gives
the location at join; its tax is calculated on that first charge. The
join must give
customer.address.countryorcustomer.ip_address; the address wins when both are given. With neither, the join answers400tax_location_requiredbefore anything is created in Stripe. A location Stripe Tax cannot place answers400tax_location_invalid, with nothing created. A free plan's join needs neither. Joining again while the first payment is unpaid resumes the join from the same place; from another, the unpaid join is replaced (its invoice voided, even if enrollment has closed since) by one taxed where the buyer is now. If the buyer paid the first one meanwhile, the join answers409membership_already_exists; poll it. - Each membership charge carries
tax_minor, the tax included inamount_minor. The subscription's Stripe invoice shows it as a tax line, as do Stripe's payment receipts when the connected account sends them.
Memberships joined while it was off stay untaxed.
States and webhooks
| State | Meaning |
|---|---|
incomplete | Subscription exists and its initial PaymentIntent still needs confirmation or provider settlement, or, for a join charged first on a later date, its card is still to be saved. |
active | The subscription invoice was paid (or, for a join charged first on a later date, its card was saved) and the member effects apply. |
past_due | The provider reported a failed invoice. Member effects do not apply, except for a member inside a benefit grace period. Dunning UX is out of scope for v1. |
paused | A paid membership was paused. Billing is stopped at the provider and member effects stopped when the pause happened. Only a successful restart payment leaves this state. |
canceled | The subscription ended. Member effects do not apply. |
Only active gives member effects, plus a past_due membership inside its
benefit grace period; status itself never changes for
grace. The engine maps Stripe's subscription
status onto these five: active, past_due, paused and canceled pass
through; incomplete_expired, a first payment Stripe let lapse, is stored as
canceled; trialing is a join charged first on a later date,
stored as active once the member saved a card for that join (a card
already on file from another membership does not count) and incomplete
until, or a member whose
next charge was moved, who stays active; every other
Stripe status (for example unpaid) is stored as incomplete. The engine
offers no free trials: a later first charge charges the full price on its
date. A paused membership still counts
as a live membership of its plan: joining the plan again answers 409
membership_already_exists until it is resumed and later ended.
A past_due membership returns to active when Stripe reports the subscription
active again (typically after a retried invoice is paid); effects apply from then.
The engine listens to Stripe for these events on your connected account and re-reads the subscription before writing state. You do not configure anything in Stripe for this; it is part of connecting your account.
invoice.paid:subscription_createactivates the first period;subscription_cyclerenews a later period. A join charged first on a later date opens with Stripe's paid $0 invoice, which records nothing; its charge on the date is asubscription_cycle.invoice.payment_failed: moves the membership topast_due. When the membership wasactiveand the failed invoice is an ordinary renewal, it also opens the plan's benefit grace period.customer.subscription.updated: mirrors provider status, period end andcancel_at_period_end. It is also how a join charged first on a later date learns its card was saved, and becomesactive. A pause and a resume reach the engine through this event too, so a pause made in the Stripe Dashboard is mirrored as well. A price change's move of the subscription also sends it; when it shows the subscription on the plan's current Price and the membership does not yet, the move is recorded from it.customer.subscription.deleted: recordscanceledandended_at.
Webhook delivery is idempotent on the PSP event id. A cancellation is terminal
against an older, out-of-order paid event. The resulting activity types are
membership.created, membership.activated, membership.renewed,
membership.updated, membership.canceled, membership.paused and
membership.resumed; plans add
membership_plan.created and membership_plan.updated. All nine arrive on
your activity stream like any other fact and are
listed under Memberships in activity types.
Effects and gated items
Quotes accept an attested customer subject:
{ "customer": { "external_ref": "partner-user-123" } }An active member receives a non-consumable percent_off effect when the plan
has a percentage, with provenance naming plan_id, membership_id and
plan_name. A plan with unlocks_gated_items: true also returns an unlock
effect naming the gated item ids in the cart. The effects are applied together
with the existing stacking rules; a membership percentage is not stackable, so
the best single exclusive price wins and provenance remains in the quote.
An anonymous or non-member quote receives the same benefit as unapplied_effects
with a generic requires.display, for example “Join Halfmoon Club for 20% off”
or “Join Halfmoon Club to unlock Members presale”. No email or personal data is
placed in this teaser. A gated item remains unsellable until an applied unlock
names it. Teasers are offered only while the customer holds no eligible
membership of the organizer, only for plans the customer could join, and only
for what would apply to the cart: see
benefits in quotes.
The door rule is separate: tickets already issued remain issued if a membership
later becomes past_due, paused or canceled. Membership state changes
affect future quotes, not admission positions already delivered. A past_due
member keeps these effects only inside a benefit grace period.
The plan's own percent_off_bps and unlocks_gated_items are the legacy
plan benefits. They keep working as described above, across every event of
the organizer, and nothing moves them into the benefits below. For a benefit
that applies only at chosen events or items, define a
membership benefit and
assign it to events instead.
Membership benefits
A membership benefit is a reusable benefit of one plan, defined once and
selected per event. Its kind is percent_off, with percent_off_bps from 1
to 10000 (the same unit as the plan field; 1000 is 10%), unlock,
permission to buy gated items, guest_invitation, which lets members invite
guests for free (see guest invitations), or
waitlist_priority, which puts members ahead of arrival order on the
assigned items' waitlists when a freed unit is offered automatically (see
waitlist priority), or fee_waiver, which
waives the booking fee on the assigned items (see
benefits in quotes). Only percent_off takes
percent_off_bps and only guest_invitation takes guest_allowance. An unlock is not
a free ticket: the member still pays for the unlocked item. A plan can have several benefits, each assigned to
different events or items, and a free plan's benefits work like a paid plan's.
A benefit can be created before any event exists. On its own it changes no price: it applies only where an event assigns it.
curl -X POST https://tickets.lissen.com/api/v1/membership_benefits \
-H 'Authorization: Bearer tk_test_…' \
-H 'Ticketing-Organizer: org_…' \
-H 'Idempotency-Key: 4a1e0c9b-…' \
-H 'Content-Type: application/json' \
-d '{
"plan_id": "mpl_…",
"name": "Family discount",
"kind": "percent_off",
"percent_off_bps": 1000
}'{
"id": "mbn_…",
"object": "membership_benefit",
"plan_id": "mpl_…",
"name": "Family discount",
"kind": "percent_off",
"percent_off_bps": 1000,
"created_at": "2030-01-10T12:00:00.000Z",
"updated_at": "2030-01-10T12:00:00.000Z",
"metadata": {}
}| Operation | Route |
|---|---|
| Create (Idempotency-Key required) | POST /v1/membership_benefits |
List, optionally ?plan_id=mpl_… | GET /v1/membership_benefits |
| Retrieve | GET /v1/membership_benefits/{id} |
| Update | PATCH /v1/membership_benefits/{id} |
| Where it is assigned | GET /v1/membership_benefits/{id}/assignments |
An update changes name, percent_off_bps (for percent_off only),
guest_allowance.units (for guest_invitation only) or metadata; plan_id
and kind are fixed, so create a new benefit to change
them. Benefits are updated with PATCH, like the other configuration
resources. An unknown plan answers invalid_reference; a percentage on an
unlock, or a percent_off without one, answers invalid_request.
Every assignment reads the live benefit. Changing Family discount from 10% to 15% applies to later quotes at every event it is assigned to. A checkout session's binding quote and a completed order keep the effects already recorded on them. Benefit edits never change a plan's price or billing.
Assign benefits to events
Benefits are chosen from the event. An assignment links one benefit to one
event with a scope:
event: every item of the event, including items added later;items: onlyitem_ids, which must be items of this event.
A benefit has at most one assignment per event, so the call is a create or replace addressed by the event and the benefit:
curl -X PUT "https://tickets.lissen.com/api/v1/events/$EVENT_ID/membership_benefits/$BENEFIT_ID" \
-H 'Authorization: Bearer tk_test_…' \
-H 'Ticketing-Organizer: org_…' \
-H 'Content-Type: application/json' \
-d '{ "scope": "items", "item_ids": ["itm_…"] }'{
"id": "mba_…",
"object": "membership_benefit_assignment",
"benefit_id": "mbn_…",
"event_id": "evt_…",
"scope": "items",
"item_ids": ["itm_…"],
"created_at": "2030-01-10T12:05:00.000Z",
"updated_at": "2030-01-10T12:05:00.000Z"
}| Operation | Route |
|---|---|
| The event's assignments | GET /v1/events/{id}/membership_benefits |
| Assign, or replace an assignment | PUT /v1/events/{id}/membership_benefits/{benefit_id} |
| Remove an assignment | DELETE /v1/events/{id}/membership_benefits/{benefit_id} |
The event view and the benefit's assignments view list the same records;
there is no separate plan-side list to keep in step.
Retries are safe. Sending the current selection again returns the same
assignment and records nothing. Sending a different selection for the same
benefit and event replaces it: an event scope and an item selection that
overlap are never stored twice. The assign and remove calls also accept an
Idempotency-Key, which replays the first response, refusals and unchanged
selections included, even after a later request has changed the assignment.
The whole request is checked before anything changes; an assignment is never saved with part of its selection dropped:
| Refusal | Code |
|---|---|
| The event or benefit does not exist for this organizer | 404 not_found |
| An item does not exist for this organizer | 400 invalid_reference |
| An item belongs to another event or to no event | 400 item_not_in_event |
items with no item_ids, event with item_ids, or a repeated item | 400 invalid_request |
| Removing an assignment that does not exist | 404 not_found |
Where a benefit applies:
- A new event has no assignments; creating it never opts it into a benefit.
- A benefit with no assignment at an event gives nothing there. Removing the last assignment leaves the benefit giving nothing, never applying to every event.
- Overlapping assignments of one benefit apply it once.
- Where several membership discounts cover the same item, the item gets the single best one, as for plan percentages today.
- An item moved to another event stops being covered by the old event's assignment.
Benefits in quotes
For each eligible membership of an active plan (active, or past_due inside
its benefit grace), a quote reads the plan's
benefits and their assignments at the events in the cart, and returns at most
one effect per benefit:
| Benefit | Applied effect |
|---|---|
percent_off | percent_off with the benefit's percent_bps, not stackable, with applies_to_item_ids listing the cart items the benefit's assignments cover |
unlock | unlock whose unlocks_item_ids lists the covered cart items that are gated; no effect when none is gated |
fee_waiver | fee_waiver, not stackable and not consumable, with applies_to_item_ids listing the covered cart items |
The effect id is membership:{plan_id}:benefit:{benefit_id}, and its
source names plan_id, membership_id, plan_name and benefit_id. A
benefit with no assignment covering the cart returns no effect at all: an
effect with empty applies_to_item_ids and applies_to_event_ids would cover
every line, so a benefit is never returned that way. Legacy plan effects are
returned beside benefit effects, unchanged and without benefit_id; the
stacking rules
then give each line its single best membership discount.
A membership fee_waiver sets a covered line's booking_fee_minor to 0 and
leaves platform_fee_minor unchanged, which you absorb, exactly as a
fee_waiver code
does, and it applies on top of any discount. A line uses one waiver: beside a
fee_waiver code the membership's waiver is used and the code is listed in
superseded_effect_ids, so it is not spent. Where waiving would leave a
platform fee at or above the line's discounted price, the membership's waiver
steps aside on that line: the line keeps its booking fee and the waiver is
superseded unless it waived another line. A fee_waiver code on that line
still refuses the quote with fee_exceeds_charge.
A customer with no eligible membership gets teasers instead, only for the
plans this customer's join would be accepted on, checked by the same rules as
the join itself. A plan is never teased when it is
earned or closed or full;
when it requires a membership the customer
does not hold as active (an anonymous quote holds none); when the customer
holds an ongoing membership of another plan in its
exclusive group; when the customer
already holds a membership of it that gives no benefits (paused, or
past_due outside its grace); or, while the organizer charges
tax on memberships, when it is a paid plan whose price does not
include tax. An unpaid join of the plan (incomplete) keeps its teaser, as
joining again resumes it. What only the join request carries, such as the
customer's tax location, is checked at the join. For each cart line
the best percentage joining would give there, from the highest legacy plan
percentage and the percent benefits assigned to that line, is teased once, with
the id the applied effect would have. A percent teaser's
applies_to_item_ids lists only the cart items where it is the best offer, so
a line carries at most one percent teaser; a legacy plan percentage that is the
best offer on every line keeps its empty, every-line scope. Each gated line is teased
with the legacy plan unlock where that plan unlocks gated items, otherwise with
the first unlock benefit assigned to it (id
membership:{plan_id}:benefit:{benefit_id}:unlock:{item_id}). Each line a
fee_waiver benefit is assigned to is teased once, by the first such benefit
in id order that would waive a booking fee there for a member of its plan, as a
fee_waiver teaser with the applied effect's id and applies_to_item_ids
listing the lines it is teased on; its display reads Join {plan} to skip the booking fee. A line with no booking fee to waive, or where the waiver would
step aside because the platform fee reaches the price a member of that plan
would pay for the same cart (after the plan's own discounts and the cart's
codes and checkout offer), gets no waiver teaser. A line no
plan or benefit covers gets no teaser.
Quotes read the live benefit, so a definition edit or an assignment change prices the next quote. The quote held by an open checkout session keeps the terms it was priced with until that session is updated or refreshed, and cannot change once payment has started; an order keeps the effects recorded on it.
Benefit definitions record membership_benefit.created and
membership_benefit.updated; assignments record
membership_benefit_assignment.created, .updated and .removed. All five
are listed under Memberships in activity types.
Guest invitations
A guest_invitation benefit lets the members of its plan invite guests: the
engine issues an ordinary complimentary ticket
to the guest and counts it against the inviting member's allowance. You own the
invitation screen and the email; the engine owns the allowance and the ticket.
You never keep a counter of your own.
Configure the allowance
Create the benefit like any other, with a guest_allowance:
curl -X POST https://tickets.lissen.com/api/v1/membership_benefits \
-H 'Authorization: Bearer tk_test_…' \
-H 'Ticketing-Organizer: org_…' \
-H 'Idempotency-Key: 7c3d…' \
-H 'Content-Type: application/json' \
-d '{
"plan_id": "mpl_…",
"name": "Bring a friend",
"kind": "guest_invitation",
"guest_allowance": { "units": 2, "mode": "per_event" }
}'| Field | Meaning |
|---|---|
guest_allowance.units | Guest tickets each member may invite per bucket, at least 1. Counted in tickets: an invitation for two guests uses two. Yours to choose; the engine has no default. |
guest_allowance.mode | per_event: every event the benefit is assigned to has its own allowance. per_period: one allowance shared by every event it is assigned to. |
guest_allowance.period | For per_period only: week, month or year. |
The benefit gives nothing until events assign it, from the event or ticket-type
setup, exactly like other benefits (assign them).
An invitation works only for an event the benefit is assigned to, and only for
the tickets the assignment covers (items scope covers just the listed ones).
units can be changed later with PATCH; the mode and period are fixed so a
spent ticket never moves between buckets. Raising units gives members the
difference at once. Lowering it below what a member has already invited leaves
those tickets issued and the member with none left to invite; nothing is taken
back.
Period boundaries are calendar periods in UTC, not rolling windows and not tied to the membership's billing date:
| Period | Bucket key | Starts | Starts afresh |
|---|---|---|---|
week | week:2026-09-28 | Monday 00:00 UTC | the next Monday 00:00 UTC |
month | month:2026-10 | the 1st, 00:00 UTC | the 1st of the next month |
year | year:2026 | 1 January, 00:00 UTC | 1 January of the next year |
The bucket is chosen from the moment the invitation is issued, not from the
event's date, so a per_period allowance is shared by every assigned event
invited to inside that period. A per_event bucket is event:<event id>.
The allowance is per member (customer) and per benefit: a member who cancels
and rejoins the plan keeps the same allowance for the bucket.
Show the allowance, then invite
Before you show the invitation screen, read the member's allowance:
GET/v1/memberships/{id}/guest_allowancecurl "https://tickets.lissen.com/api/v1/memberships/$MEMBERSHIP_ID/guest_allowance?benefit_id=$BENEFIT_ID&event_id=$EVENT_ID" \
-H 'Authorization: Bearer tk_test_…' \
-H 'Ticketing-Organizer: org_…'{
"object": "guest_allowance",
"benefit_id": "mbn_…",
"membership_id": "mbs_…",
"customer_id": "cus_…",
"event_id": "evt_…",
"mode": "per_event",
"period": null,
"bucket": { "key": "event:evt_…", "starts_at": null, "ends_at": null },
"limit_units": 2,
"used_units": 1,
"remaining_units": 1
}event_id is required for a per_event allowance and optional for
per_period, whose bucket.starts_at and bucket.ends_at say when it starts
afresh. This read does not judge eligibility or assignment; the invitation does.
When the member picks an event and types a guest's email, invite:
POST/v1/guest_invitationscurl -X POST https://tickets.lissen.com/api/v1/guest_invitations \
-H 'Authorization: Bearer tk_test_…' \
-H 'Ticketing-Organizer: org_…' \
-H 'Idempotency-Key: invite-mem-4411-low-tide-1' \
-H 'Content-Type: application/json' \
-d '{
"membership_id": "mbs_…",
"benefit_id": "mbn_…",
"item_id": "itm_…",
"quantity": 1,
"recipient": { "email": "guest@example.com", "name": "Sam Guest" }
}'membership_id is the member's identity, as your own authentication has
established it: a trusted partner call. The recipient's email never identifies
the inviter, and the recipient needs no account. The recipient is named as on
a comp (id, external_ref or email)
and may be anyone, including the member themselves. The answer is 201:
{
"object": "guest_invitation",
"inviter": { "membership_id": "mbs_…", "customer_id": "cus_…", "benefit_id": "mbn_…" },
"order": {
"id": "ord_…",
"customer_id": "cus_…",
"total_minor": 0,
"payment_state": "paid",
"issuance": {
"type": "comp",
"capacity_override": false,
"guest_invitation": {
"benefit_id": "mbn_…",
"membership_id": "mbs_…",
"inviter_customer_id": "cus_…",
"bucket": "event:evt_…",
"usage_id": "ivu_…",
"units": 1,
"returned_units": 0
}
},
"positions": [ { "id": "pos_…", "holder_customer_id": "cus_…", "price_minor": 0, "admission_code": "…", "qr_image_url": "…" } ]
},
"allowance": { "object": "guest_allowance", "limit_units": 2, "used_units": 2, "remaining_units": 0 }
}(allowance is the full object shown above.) The order is an ordinary comp:
the recipient is its customer and the holder of every ticket, the inviting
member is a different role recorded in issuance.guest_invitation (not
necessarily a different person: a member named as the recipient gets their own
free ticket, counted like any guest),
and positions, admission
codes, capacity and activity are those of any order. Deliver the ticket from
the feed: order.created carries the order, the guest's buyer_email and the
positions with their QR URLs, and position.created follows for each ticket,
the same facts you already handle for comps.
What the engine checks, in one transaction, before anything is written:
| Check | Refusal |
|---|---|
membership_id, benefit_id or item_id does not exist for this organizer | 400 invalid_reference |
The membership gives no member benefits now: paused, canceled, incomplete, or past_due outside its benefit grace, or its plan is inactive | 422 membership_not_eligible (detail.status) |
The benefit is not a guest_invitation benefit of the member's plan, or is not assigned to the item's event and ticket type | 422 guest_benefit_not_applicable |
The whole quantity does not fit in what is left of the allowance | 422 invitation_allowance_exceeded (detail.shortfalls) |
Not enough capacity for quantity | 422 insufficient_capacity |
| No usable recipient, or a recipient without an email | 400 invalid_request, 422 buyer_identity_required |
A member cannot override capacity: there is no capacity_override field, and
the operator comp route never spends a
member's allowance or grants a member entitlement. A refusal consumes nothing.
Idempotency-Key is required: a retry returns the same invitation and spends
nothing twice, even after the allowance has since changed. Two different
invitations sent at once are decided one at a time, so a member can never go
past the limit.
What counts, and giving units back
An invitation is spent when the ticket is issued. Failures and retries consume nothing. The engine never restores an allowance by itself. A guest ticket that is transferred, canceled, refunded or revoked keeps counting, and so does one for an event that is cancelled. Whether the member gets the place back is your decision, and the engine takes no stance on it. For that, and for audit, every accepted invitation is kept with the inviting member and membership, the benefit, the bucket, the units, the units you returned and the order and positions issued:
GET/v1/membership_benefits/{id}/guest_invitationsThe list is newest first, filterable by membership_id and event_id, and
each row is a guest_invitation_usage. The same inviter, benefit and bucket are
on the order's issuance.guest_invitation (with its usage_id), and so on
order.created.
An idempotent replay keeps the original response: an invitation issued before
invitation returns were available omits usage_id and returned_units on its
order. Read the order with GET /v1/orders/{id} for its usage id and current
returned units, including after giving units back.
To give a member their place back, return the units of the invitation's usage:
its id on the list, or issuance.guest_invitation.usage_id on the order.
curl -X POST https://tickets.lissen.com/api/v1/invitation_usages/$USAGE_ID/returns \
-H 'Authorization: Bearer tk_test_…' \
-H 'Ticketing-Organizer: org_…' \
-H 'Idempotency-Key: return-sam-low-tide' \
-H 'Content-Type: application/json' \
-d '{}'{} gives back every unit not yet returned; { "units": 1 } gives back one.
The answer is 201 with an invitation_return (id, usage_id, order_id,
event_id, units). The units go back to the bucket they were spent in, so a
per_period return after the period has ended gives the member nothing they
can still use. The member's used_units drops by units, the usage's
returned_units rises, and the feed carries invitation_return.created. A
return does not cancel the guest's ticket: do that with a
refund-and-revoke first if the guest
is not coming. A usage never gives back more than it took: more than is left
answers 409 invitation_return_exceeds_remaining (with
detail.remaining_units), and a usage already given back in full answers
409 invitation_usage_fully_returned. Idempotency-Key is required; a retry
answers the same return.
Free plans
A plan with price_minor: 0 is free. The rest of this section is everything
that differs; anything it does not mention works as for a paid plan.
| Paid plan | Free plan | |
|---|---|---|
interval on create | Required: month or year | Omit or send null; any interval is refused |
interval on the plan | month or year | null |
| Stripe Product and Price | Created on the connected account | None |
| Connected account, fee schedule | Required | Not needed |
Join response payment | The three credentials | null |
| Membership after join | incomplete until the first invoice is paid | active at once, started_at set |
current_period_end | Set from the subscription | Always null |
| Renewal | Every interval, membership.renewed | Never |
grace_days (benefit grace) | 0 to 365 | Always 0; a larger value is refused |
POST /v1/memberships/{id}/cancel | Cancels at period end | Ends now: canceled, ended_at set |
| Pause, resume, undo cancellation | Available, see Pause and resume | Refused: membership_no_billing |
| Activity types | created, activated, renewed, updated, canceled, paused, resumed | created and activated on join, canceled on cancel |
| Ledger entries | membership_charge per paid invoice | None |
These fields do not apply to a free plan and hold no value rather than an
invented one: interval and current_period_end are null,
cancel_at_period_end stays false, and payment is null. No Stripe
Customer or Subscription exists, so no provider event ever refers to a free
membership.
Handle null before you read these. Since free plans, MembershipPlan.interval
and MembershipCreated.payment can be null, and a plan's price_minor can
be 0. An integration written before free plans that assumes a plan always
has an interval, or that a join always returns payment credentials, must
check for null first.
Everything else is shared with paid plans. Duplicate protection, idempotent
joins, organizer isolation and the plan edit rules are the same. Effects
depend only on an active membership of an active plan, whatever its price.
A free membership and a paid one on different plans can coexist, and joining
one never cancels the other.
Require a membership to join
A plan can name another plan of the same organizer as its prerequisite. Set
required_plan_id when creating the plan, or later with
POST /v1/membership_plans/{id}; send null to remove it. Without one, the
plan joins exactly as described above. The plan reads back with the same
field, null when there is none, so a client can show the gate before
offering the join.
{ "name": "Halfmoon Club", "price_minor": 1000, "interval": "month", "currency": "GBP", "required_plan_id": "mpl_…" }A customer can join the plan only while they hold an active membership of
the required plan. The engine checks this on every POST /v1/memberships, for
paid and free plans alike, before it creates anything: no Stripe Customer or
Subscription, no membership, and no customer record for someone the engine has
not met. A customer who fails the check gets 422
membership_prerequisite_not_met:
{
"error": {
"type": "invalid_request_error",
"code": "membership_prerequisite_not_met",
"message": "Joining this plan requires an active membership of \"Family\"",
"param": "plan_id",
"detail": { "required_plan_id": "mpl_…", "required_plan_name": "Family" },
"request_id": "req_…"
}
}What counts is the status of the customer's membership of the required plan at the moment of the join:
| Customer's membership of the required plan | Can join |
|---|---|
active (including one set to cancel at period end) | Yes |
incomplete, past_due, canceled, or any status other than active | No |
| None, or the customer does not exist yet | No |
To grey out the offer before the customer clicks, read the plan's
required_plan_id and check
GET /v1/memberships?customer_id=…&plan_id=…&status=active. The join call is
still the authority: a stale page or a retry is refused the same way, and a
refused call stored under an Idempotency-Key replays its refusal, so retry
with a new key once the customer qualifies.
The prerequisite only decides who may join:
- Earning the required membership enrols, charges and switches nobody. The customer still joins the gated plan with their own explicit call.
- Losing it later (cancellation, a failed payment) changes nothing about a membership already on the gated plan. It is not rechecked at renewal; the membership keeps its normal lifecycle. Joining again after the gated membership ended is a new join and needs the prerequisite again.
- Organizers are isolated: the required plan must belong to the same
organizer (
400invalid_referenceotherwise), and only that organizer's memberships are consulted. - A plan cannot require itself, and a plan cannot require one that already
requires it, directly or through others (
400invalid_request). Chains such as A requires B requires C are allowed, and each plan checks only its own prerequisite when someone joins it. - It is one plan reference, not a rule language: no combinations, counts or attendance conditions.
Alternative plans in an exclusive group
Plans can be marked as alternatives by giving them the same
exclusive_group: a name of 1 to 100 characters (surrounding spaces are
trimmed, the match is exact, so Offers and offers are different groups).
Set it when creating the plan, or later with POST /v1/membership_plans/{id};
send null to leave the group. The plan reads back with the same field,
null when it has none. A group is just that shared name inside one
organizer: there is nothing else to create, and groups of different organizers
never meet.
{ "name": "Founding", "price_minor": 2000, "interval": "month", "currency": "GBP", "exclusive_group": "Paid offers" }A customer can hold only one ongoing membership among the plans of a group.
The engine checks this on every POST /v1/memberships, for paid and free plans
alike, before it creates anything (no Stripe Customer or Subscription, no
membership, no customer record), and again under a lock that serializes the
customer's joins across the whole group, so two simultaneous joins of
different alternatives cannot both succeed. A refused customer gets 409
membership_group_conflict naming the membership in the way:
{
"error": {
"type": "invalid_request_error",
"code": "membership_group_conflict",
"message": "The customer already has an ongoing membership of \"Founding\" in the group \"Paid offers\"",
"param": "plan_id",
"detail": {
"group": "Paid offers",
"membership_id": "mbs_…",
"plan_id": "mpl_…",
"plan_name": "Founding",
"status": "active",
"cancel_at_period_end": false
},
"request_id": "req_…"
}
}"Ongoing" is any membership that is not canceled:
| The customer's existing membership in the group | Joining an alternative |
|---|---|
incomplete (first payment pending) | Refused |
active, including one set to cancel at period end, until it actually ends | Refused |
past_due | Refused |
paused | Refused |
canceled | Allowed |
| None | Allowed |
Everything else is unchanged:
- Plans outside the group, and plans in other groups, coexist freely. With
Founding and Standard in one group and a free Family plan outside it, a
customer can hold Family and Founding, or Family and Standard, but not
Founding and Standard together. A plan with no
exclusive_groupis never affected, and grouping is independent of price, benefits, attendance and join prerequisites. - Joining the same plan twice is still
membership_already_exists, grouped or not, and finishing your own unfinished join of the plan (the idempotent resume of anincompletemembership) is not a second enrolment. - Resuming a paused membership, or undoing a scheduled cancellation, is the same membership, not a join, and is never refused by the group.
- The engine never switches plans: no automatic upgrade, downgrade, proration,
cancellation or replacement. To move a customer, end the existing membership
and let them join the other plan once it is
canceled. The refusal depends on current memberships, so it is not stored under theIdempotency-Key: the very same request can succeed once the existing membership has ended. - Changing group configuration never cancels, edits or hides an existing
membership, and the join check is the only enforcement. Putting plans into a
group that customers already hold together leaves those customers as they
are.
GET /v1/membership_plan_groupslists every group with its plans and, underconflicts, each customer who already holds more than one ongoing membership in it (theirmembership_ids), so you can decide what to do. Those customers cannot join a further alternative until they are down to the plan they keep.
Close enrollment or cap members
Two settings decide who can still join a plan. They are separate from
active, which decides whether the plan's effects apply to the people who
already belong:
| Setting | Stops new joins | Stops existing members' benefits | Touches Stripe |
|---|---|---|---|
active: false | Yes (the plan answers not_found to a join) | Yes: members get no price effects, unlocks or benefits | No: billing continues |
enrollment_open: false | Yes (membership_enrollment_closed) | No | No |
member_cap reached | Yes (membership_enrollment_full) | No | No |
Use active to retire a plan. Use enrollment to stop taking new members
while everyone who has joined keeps their price, billing, renewals and
benefits. Closing enrollment never cancels a subscription, stops an effect or
changes a price, and it never changes the Stripe Product or Price.
# Close a plan to new members, whatever its size.
curl -X POST https://tickets.lissen.com/api/v1/membership_plans/mpl_0199c4f0-1a2b-7c3d-8e4f-5a6b7c8d9e01 \
-H 'Authorization: Bearer tk_test_…' -H 'Ticketing-Organizer: org_…' \
-H 'Content-Type: application/json' \
-d '{ "enrollment_open": false }'
# Or open a limited offer: the first 25 members, then it closes itself.
curl -X POST https://tickets.lissen.com/api/v1/membership_plans \
-H 'Authorization: Bearer tk_test_…' -H 'Ticketing-Organizer: org_…' \
-H 'Idempotency-Key: …' -H 'Content-Type: application/json' \
-d '{ "name": "Halfmoon Founders", "currency": "GBP", "price_minor": 1000,
"interval": "month", "member_cap": 25 }'Both settings are optional on create and update: a plan without them is open
and uncapped, as every plan was before. The settings are the same for paid and
free plans. member_cap is a whole number of 1 or more; send null to remove
it.
Reading the state
Every plan read carries the settings and the resulting state, so a client can present the offer without trying a join:
{
"id": "mpl_…",
"active": true,
"enrollment_open": true,
"member_cap": 25,
"enrollment": { "status": "open", "places_left": 3 }
}enrollment.status | Meaning |
|---|---|
open | A new customer can join. |
closed | The owner set enrollment_open: false. Closed wins over full. |
full | The plan has a cap and no place is left. |
places_left is null without a cap. It counts places already taken and
places held by a join whose first payment is still pending, so it is the number
a join could win right now. It is independent of active.
How places are counted
Places are accounted per membership, under a lock on the plan, never by counting rows and inserting afterwards, so concurrent joins cannot pass the cap.
- A free join takes a place when the membership is created.
- A paid join reserves a place when the membership is created
incomplete, for up to 24 hours: longer than the 23 hours after which Stripe expires an unpaid subscription. The reservation becomes permanent when the first payment activates the membership (for a join charged first on a later date, the saving of its card). If the payment is abandoned, the subscription expires or the membership is canceled before it was paid, the place is released; an abandoned hold also frees itself when its 24 hours end, with nothing to clean up. - Retrying an unfinished paid join (a new key for the same customer and plan) resumes the membership and its place and consumes no further one. A same-key retry replays the stored answer.
- Renewals and resuming a paused membership are not signups: they belong to the same membership and take no place. A paused membership keeps its place.
- A taken place is never given back. If a member of a full cohort cancels,
the plan stays
full: a founding offer does not silently reopen. To admit more people, an owner raisesmember_cap(only the added room becomes available) or removes it withnull. Setting a cap on a plan that had none counts the memberships that are live at that moment as the first places; memberships that had already ended are not part of the cohort. Removing a cap and setting one again starts the count again from the live memberships. - A customer who joins again after their earlier membership ended is a new signup: they need an open plan and a free place like anyone else. There is no grandfathered re-entry.
Refusals
A closed or full plan refuses POST /v1/memberships with 409
membership_enrollment_closed or membership_enrollment_full, before
anything is created: no Stripe Customer or Subscription, no membership and no
customer record. The authority is the join itself, not the plan read: a stale
page, or two customers racing for the last place, are answered the same way,
and the loser of a race has any Stripe subscription it had begun undone. The
checks come after the prerequisite. Neither
refusal is stored under the Idempotency-Key: a 409 releases the claim, so a
retry, with the same key or a new one, is decided afresh once the plan reopens.
An unfinished join that was started before the plan closed or filled is not
refused: it already holds its place, and its payment credentials were issued.
There is no administrative bypass for joins: every joined membership is
created through this join, so nothing enrols a customer in a closed or full
plan. The one membership the join does not create is an
earned one: a plan with an attendance rule refuses
joins outright (membership_plan_earned_only) and grants memberships to
customers who qualify, so its enrollment settings, member cap, prerequisite
and exclusive group do not limit those grants. For the same reason a plan
with an attendance_rule reads enrollment.status: open (or whatever its
enrollment_open and member_cap say) but the object describes nothing: no
join is ever accepted, so do not use it to offer a join.
Earned memberships
A free plan can carry an attendance_rule. The engine then grants a
membership of the plan to a customer who attended enough events, with no join,
and the numbers are the organizer's configuration. Nothing about Family, four
visits or twelve months is built in.
The rule
{ "threshold": 4, "window_months": 12, "retention": "keep", "scope": "all_events" }| Field | Meaning |
|---|---|
threshold | Distinct events attended, 1 to 1000. |
window_months | The rolling lookback, 1 to 120 whole months, ending now. |
retention | keep or maintain. No default: you choose. |
scope | all_events or selected_events. No default: you choose. |
Set it with attendance_rule on POST /v1/membership_plans or
POST /v1/membership_plans/{id}; null removes it. The whole rule is sent
each time. Only a free plan can have one (400 invalid_request on a paid
plan), and the plan reads back with the same field. Removing a rule leaves the
memberships it granted exactly as they are; nothing ends them afterwards.
What counts as a visit
A visit is the derived attendance fact: one customer at one event, supported by an admitted, non-voided check-in that credited them as the ticket holder at the door. The rule counts distinct events:
- Several orders, tickets or scans for one event are one visit.
- A ticket that was bought but never scanned, a rejected or superseded scan and a voided scan are not visits. Paid, free and complimentary tickets all count: the rule has no ticket-type filter.
- A visit is dated by its earliest admitted scan (
first_admitted_at). It counts while that instant is inside[now - window_months, now]. The start is inclusive and months are calendar months in UTC: three months before 31 May is 28 or 29 February at the same time of day. There is no calendar-year reset; the window slides. A visit to an event the customer already visited adds nothing, so a second scan there never refreshes an old visit. - With
selected_events, only visits to events that count toward the plan.
Which events count
For selected_events an event counts toward a plan only when it says so,
from the event's side:
| Operation | |
|---|---|
PUT /v1/events/{id}/qualifying_plans/{plan_id} | The event counts toward the plan. Repeating it changes nothing and records no activity. |
DELETE /v1/events/{id}/qualifying_plans/{plan_id} | It stops counting. 404 if it did not. |
GET /v1/events/{id}/qualifying_plans | The plans the event counts toward. |
GET /v1/membership_plans/{id}/qualifying_events | The same rows, from the plan's side. |
The event can be in the future and can have no attendance yet, so events that
do not exist when the plan is created are added as they are created. Counting
toward a membership is independent of membership benefits:
neither implies the other. A plan without a rule answers
attendance_rule_not_configured, and one whose rule counts every event
answers attendance_scope_not_selected. Adding or removing an event
re-evaluates the customers who attended it. The rows are kept if the scope is
later switched to all_events (they are ignored) and count again if it is
switched back.
Granting
The engine evaluates a customer for a plan whenever something that can change the answer happens, always by the same rule, and acts only on the difference:
| Situation | Result |
|---|---|
| Qualified, no live membership of the plan | A membership is created, already active, with source: "earned". membership.created and membership.activated follow, by a system actor attendance_rule:<plan id>. |
| Qualified, a live membership already (earned or joined) | Nothing. A customer has one live membership of a plan. |
| Not qualified | Nothing is granted. |
The plan is not active | Nothing is granted; maintain memberships still end. |
An earned grant is not a join. It does not pass the checks meant for public
sign-up: the plan's own required_plan_id is not consulted, and there is no
customer-supplied identity to check. It never subscribes to, charges for,
replaces or cancels any other membership, paid or free, and it only ever
looks at memberships of its own plan.
A plan with a rule cannot be joined: POST /v1/memberships answers 422
membership_plan_earned_only. Memberships that already existed before a rule
was attached have source: "joined" and the rule never ends them.
When the evaluation runs
- When attendance changes. A scan that admits the first ticket of a
visit, a void, a superseding earlier scan, a credit correction and a
recipient's claim all report
attendance.recordedorattendance.removed. The evaluation happens in the same transaction, so the grant or end commits with the evidence and its activities follow the attendance activity. A failure of the evaluation never fails a door scan; the next sweep repeats it. - As time passes. A
maintainmembership ends when visits age out even if the customer attends nothing. A worker sweep runs every five minutes and is idempotent, so a membership ends on the first pass afterqualified_until, not necessarily at that instant. The sweep is also the safety net for everything above. - When a rule is edited. Saving a changed rule re-evaluates the
organizer's customers against the new rule: customers who now qualify are
granted and, under
maintain, earned memberships that no longer qualify are ended. The request handles up to 200 customers and the sweep finishes the rest within minutes. Creating a plan with a rule counts attendance that already happened. Reactivating an inactive plan is picked up by the sweep.
Keep and maintain
retention | A customer stops qualifying (visits age out, a visit is voided or corrected away, the rule is raised, an event stops counting) |
|---|---|
keep | The earned membership stays. Corrections to false evidence are explicit: a void or a credit correction never silently takes a membership away. End it yourself with cancel. |
maintain | The earned membership ends: canceled, ended_at set, membership.canceled by the attendance_rule actor. Qualifying again, with new visits, earns a fresh membership; the ended one stays as history. |
maintain ends only memberships with source: "earned". Voiding a scan that
never counted changes nothing.
Ending one yourself
POST /v1/memberships/{id}/cancel works on an earned membership as on any
free membership: it ends now. That is an explicit removal and it sticks. The
customer is not granted the plan again just because their old visits still
qualify; they earn it again by a counted visit whose first scan is later than
the cancellation. An end by maintain is different: qualifying again earns it
at once, because the engine, not a person, ended it.
Reading progress
GET /v1/membership_plans/{id}/qualification?customer_id=… computes the
customer's standing now: visits_counted of threshold, window_start and
window_end, qualified, qualified_until (when the threshold-th most recent
visit leaves the window; null while not qualified), the counted visits
newest first, membership_id (their live membership of the plan, if any) and
earned (whether the rule granted it). It answers for customers who have
earned nothing and is read-only. A plan with no rule is 422
attendance_rule_not_configured.
Pause and resume
A paid membership can be paused and restarted through the API. You own the
customer-facing controls; the engine keeps billing, benefits
and activity consistent. All three operations below require an
Idempotency-Key, are scoped to the organizer, and answer 404 for a
membership that is not the organizer's.
| Operation | Allowed when | Billing | Membership and benefits |
|---|---|---|---|
POST /v1/memberships/{id}/pause | active, no cancellation scheduled | Pauses immediately. The unused part of the paid period is credited toward the next invoice. It is not refunded in cash, and there is no way to schedule a pause for the period end. | paused; benefits stop at once, so the very next quote prices at list. |
POST /v1/memberships/{id}/resume | paused | Same plan, at the membership's price_minor. A fresh billing period starts now on the existing interval; the credit is applied and any balance is collected from the customer's saved payment method. | Returns to active, and benefits return, only after the provider reports the subscription active again. |
POST /v1/memberships/{id}/undo_cancellation | active or past_due, cancellation scheduled | None. No charge; price and renewal date are unchanged. | Continues without interruption. |
Pause. The membership's subscription is paused natively at the payment
provider (Stripe), which stops it generating invoices; it is not the
collection-only pause that leaves a subscription active. The unused-time credit
is calculated once, by Stripe. Example: a 10 GBP a month membership paused
halfway through a paid month is credited roughly 5 GBP toward its next
invoice. An invoice that already exists keeps moving while paused, so pausing is
not forgiveness of money already owed. current_period_end becomes the time of
the pause, and membership.paused is recorded. A pause is refused with
membership_state_conflict unless the membership is active and not scheduled
to cancel (undo the cancellation first), with membership_no_billing for a
free membership, and with membership_pause_unsupported when
the subscription does not meet the provider's prerequisites: flexible billing
mode, automatic collection, no subscription schedule, and an active status.
The engine never migrates existing subscriptions to make them eligible, and not
every subscription created before this feature qualifies. A paused membership
cannot be canceled: resume it first.
Resume. The restart invoice is the pause credit plus a full new period at
the membership's price_minor, the plan's new price when the plan was
repriced while it was paused. Example: resuming the 10 GBP membership above collects about
5 GBP, and the new month runs from the restart date. A restart invoice fully
covered by credit needs no payment, and the membership becomes active
straight away. The response is { "membership": …, "payment": … }:
membership.statusisactiveandpaymentisnullwhen the provider already reports the subscription active.membership.resumedis recorded once, with the newcurrent_period_end.membership.statusstayspausedwhen the restart payment is still unpaid or failed. No benefits return and nomembership.resumedis recorded. When the restart invoice is open and payable,paymentcarries the usual three credentials so the customer can complete or retry it with a Payment Element; otherwise it isnull. When a payment later succeeds the provider reports the subscription active, the membership becomesactiveandmembership.resumedis recorded. PollGET /v1/memberships/{id}or follow the activity stream; do not treat the 200 as the restart.- The provider refusing the payment outright (for example, the customer has
no usable payment method) answers
422membership_resume_payment_failed, leaves the membershippaused, and can be retried after the customer fixes their payment method, with a newIdempotency-Key.
Resume never changes the plan or price and never creates a new subscription. An ended membership is not revived; it uses the normal join.
Undo a scheduled cancellation. Clears cancel_at_period_end on the same
subscription before the period closes, so the membership renews as usual. It is
recorded as membership.updated (with cancel_at_period_end now false in
the snapshot). If the subscription has already ended at the provider, or the
membership is canceled, the request answers 409 membership_state_conflict:
a stale request never reactivates an ended subscription.
Retries and ordering. Repeating a request with the same Idempotency-Key
replays the stored answer without calling the provider again or recording a
second activity. A pause, resume or reversal that reached the provider before
the engine recorded it is completed on retry rather than repeated, and the
provider's own events reconcile the same state without duplicating it: each
transition is recorded once, whichever path sees it first.
What a pause does not touch. Tickets already issued stay valid, and nothing at admission checks a membership. Only the paused membership's effects stop; the customer's other memberships are unaffected.
Payments and refunds
Each paid invoice becomes a settled membership charge, once, even when it
is paid after the membership ended (for example, its subscription was
cancelled in the Stripe Dashboard while the join was being made). Charges are
listed by
GET/v1/memberships/{id}/charges, with what has
been refunded and what can still be, and the tax included in its
amount (tax_minor, 0 when the organizer does not charge tax on memberships). Refund a charge with
POST/v1/refunds and its membership_charge_id;
see Refunding a membership payment.
A refund returns money only: the membership is not cancelled or paused, its
benefits and renewal schedule are unchanged and no ticket is revoked, and a
refund never counts as paying an overdue renewal. Ending the membership stays a
separate action, below.
Benefit grace period
A paid plan can keep its benefits available for a number of days after a
renewal payment fails, so a member has time to fix their card without losing
member prices or unlocks the next morning. Set it with grace_days on the plan
(whole days, 0 to 365); it is also in the admin plan editor.
curl -X POST https://tickets.lissen.com/api/v1/membership_plans/mpl_0199c4e2-8a1b-7c20-9d31-5e6f7a8b9c0d \
-H 'Authorization: Bearer tk_test_…' \
-H 'Ticketing-Organizer: org_…' \
-H 'Content-Type: application/json' \
-d '{ "grace_days": 5 }'grace_days defaults to 0, which is no grace: a plan that never sets it
behaves exactly as before. A free plan has nothing to renew and
refuses a value above 0 with invalid_request. The engine hard-codes no
duration; every organizer picks their own.
What starts it. A membership that is active and whose ordinary renewal
invoice (subscription_cycle) fails becomes past_due and, if the plan has
grace_days above 0, opens one grace window. grace_started_at is the moment the engine
records the failure and grace_ends_at is grace_days whole 24-hour days
later. Both timestamps are on the membership (GET /v1/memberships/{id} and
the list) and on the membership.updated activity that records the failure.
in_grace is computed at read time from them and the clock: it is on reads
only, not in activity snapshots. They let a partner explain "your benefits end
on Friday" or "your benefits ended on Friday". status stays past_due throughout: grace is a
separate eligibility fact, never a pretend payment or an active state.
| Membership situation | Grace |
|---|---|
active, ordinary renewal fails | Starts (if the plan has grace_days) |
past_due, further retries fail, duplicate or out-of-order events arrive | Unchanged: the window is never restarted or extended |
| A member updates their card | Unchanged, unless the new card pays the overdue invoice: then cleared |
Renewal is paid, subscription active again | Cleared; a later failure starts a new window |
incomplete (first payment never completed) | None |
paused and a failed resume payment | None: a paused member must pay to resume, as before |
canceled, or Stripe reports unpaid or another non-past_due status | Ends at once and is cleared |
A past_due membership that began before grace existed | None |
What it gives. While in_grace is true the membership counts as eligible in
the same place an active one does, so the quote, the binding checkout quote and every
benefit behave exactly as for an active member: the same
definitions, the same event and ticket scopes, the same inventory and capacity.
Grace does not widen a benefit, reset a counter or reserve stock. Tickets
claimed during grace are ordinary issued positions. When the window ends,
new quotes stop granting benefits; no webhook is needed, because the engine
compares grace_ends_at with the current time on every quote and read. The
deadline is exclusive: at grace_ends_at itself the benefits are already gone.
Nothing is recorded when a window lapses. Tickets already issued stay valid
under their existing admission contract, and a quote already bound before the
deadline keeps its price.
Editing the plan. The deadline is fixed when the episode starts. Changing
grace_days afterwards, even to 0, does not lengthen or shorten a window
already running; the new value applies from the next failed renewal. Closing
enrollment (active: false) is a separate setting and is not affected by this.
What it does not do. It is not a join prerequisite
substitute: only an active membership satisfies one, so a member in grace
cannot use their membership to join a plan that requires it. It does not change
the payment provider's retry schedule, emails or subscription settings, and it
does not apply to a join or a resume. A failed
charge now is a failed renewal, so it starts
a window too. Messaging to the member is the partner's to write.
Cancel at period end
POST /v1/memberships/{id}/cancel on a paid membership sets Stripe's
cancel_at_period_end and mirrors it in the membership; a free membership has
no period and ends at once. A paused membership is refused
with 409 membership_state_conflict: resume it first,
then cancel. Immediate cancellation of a paid
membership, proration, plan changes,
dunning UX and a general Stripe Customer Portal are out of scope; the one
portal flow the engine offers is the
payment-method update. The current period's
member effects remain available until the provider reports the subscription as
ended; the UI should show the scheduled end rather than implying an immediate
revocation. A scheduled cancellation can be undone until
the subscription ends.
Update the payment method
A member replaces the card their membership bills on a Stripe-hosted page. The
partner authenticates the member and asks the engine for a session; the member
enters the card on Stripe, never on the partner's page, and Stripe returns them
to the partner's return_url.
curl -X POST https://tickets.lissen.com/api/v1/memberships/$MEMBERSHIP_ID/payment_method_update_sessions \
-H 'Authorization: Bearer tk_test_…' \
-H 'Ticketing-Organizer: org_…' \
-H 'Content-Type: application/json' \
-d '{
"return_url": "https://halfmoon.live/account",
"customer_id": "cus_…"
}'{
"object": "membership_payment_method_update_session",
"membership_id": "mbs_…",
"url": "https://billing.stripe.com/p/session/…"
}Redirect the member to url. It is single-use and short-lived, so create a
new session for every attempt; the call takes no Idempotency-Key and every
call opens a fresh session.
- Authorization. The engine resolves the membership inside the organizer
named by
Ticketing-Organizer, then uses that membership's own Stripe Customer on the organizer's connected account, in the organizer's test or live mode. Nothing in the request names a Stripe customer, so a caller cannot point the page at someone else's.customer_idis an optional guard: send the customer your own session resolved, and a membership that belongs to another customer answers404as if it did not exist. return_urlfollows a checkout session's rule: HTTPS, or the registered app callback. Anything else is400.- Nothing else is offered. The page is the payment-method update and
nothing more: no cancellation, plan change, invoice history or contact
edit. The engine keeps a minimal customer-portal configuration of its own on
the connected account (found by a
lissen_portalmetadata tag, created once if missing) and does not use or alter the organizer's own portal settings. A tagged configuration that has since been widened to allow cancellation or plan changes is not used. - Who can update.
active,past_dueandpausedmemberships, including one set to cancel at period end. A paused member whose restart payment was refused can fix the card here and then resume. A free membership has no payment method and anincompleteone is still awaiting its first payment: both answer422membership_not_billable. Acanceledmembership answers409membership_already_canceled. No Stripe object is created for any of them. - Unavailable accounts. If Stripe will not open the portal for the
organizer's account, the answer is
422payment_method_update_unavailable; a transient Stripe fault answers a retryable503connect_provider_unavailable. Stripe's own error text is never forwarded.
Which payment method the membership bills
The payment method is customer-wide on the organizer's connected account.
Stripe stores the member's choice as the Customer's default payment method, and
a Subscription's own default takes precedence over it. The engine saves the
first payment's card on the subscription, so a Customer default alone would
leave the membership billing the old card. The engine therefore reacts to
Stripe's customer.updated event: when the Customer's default payment method
changed, it reads the Customer and, for each non-canceled membership
subscription it holds for that Customer that carries its own default, sets that
default to the new method. Consequences:
- The change reaches the subscription shortly after the member returns, not before; Stripe is read again at that moment, so a redelivered event changes nothing twice.
- A subscription with no default of its own already uses the Customer's.
- Subscriptions that are not the engine's memberships are never touched, and no default is ever cleared.
- Two memberships held by the same customer on the same organizer share the Customer, so both move to the new method.
A card update collects what is overdue
Changing the card changes nothing about the membership itself: it keeps its
id, plan, price and current_period_end, and the card change records no
activity. For a past_due membership the engine then makes one attempt to
pay the open overdue invoice with the new card, once Stripe has confirmed the
change. When it is paid, Stripe reports the invoice paid and the membership
returns to active through invoice.paid (membership.renewed, with its
charge), clearing its grace. If the new card is declined the membership stays
past_due and Stripe's retries carry on as before; nothing is charged twice
for a redelivered event. Other memberships are not charged: an active or
paused member's card change is only a card change. Show the member that
their card was saved, then read the membership for whether they are paid up.
To try again later, call next charge with
now.
Memberships
A recurring subscription on your Stripe account that turns into member pricing on every cart — told through one promoter, one plan and one member
Testing renewals
Try a membership renewal, a failed renewal and its recovery in test mode, in minutes, with the next charge action and Stripe's test cards