The buyer plane
The session-scoped client secret, the calls it authorizes, and how a browser pays with it
Your API key can sell and read on behalf of your whole organizer. It must never reach a browser. So a checkout session mints a second credential — a client secret — scoped to that one session, expiring with it, and deliberately the weakest credential the engine issues.
That credential is what makes a headless checkout possible: your own frontend renders the cart and the payment form, talking to a small buyer-safe subset of the API, while your server keeps the key.
The credential
client_secret is returned by
POST/v1/checkout_sessions, and by nothing else:
not a retrieve, not a list, not an activity payload — there is no field for it
to occupy on any of those.
Retrying that create with the same Idempotency-Key is the one exception, and
it is deliberate: a replay returns the identical response, this field included,
so a create whose answer you lost to a timeout is recoverable by the retry you
were going to make anyway.
A closed session stops authorizing changes. Once a session reaches a
terminal state that same Idempotency-Key answers 409
checkout_session_not_open instead of a credential that would no longer
authorize changes. An existing secret may still retrieve the outcome (or
finalize, which then reads it), or retry
zero-total completion, until one hour after session expiry. There is no other way to recover a client secret — create
a new session.
It looks like this — the session id, then the secret:
cs_0199c4e6-3a55-7d0e-9f21-4a7c8b2d6e33_secret_9Qb1n…Send it as a bearer token, exactly like an API key:
-H "Authorization: Bearer cs_0199c4e6-..._secret_9Qb1n..."What is different about it
- No organizer header. A buyer's browser holds nothing that names a tenant,
so the engine derives the organizer from the session itself. Sending
Ticketing-Organizeris unnecessary here. - No
Idempotency-Key. The buyer plane refuses the header with a400rather than ignoring it — a cart edit is not a duplicate purchase, and retry semantics belong to the keyed plane. - One session, and only one. Pointing a valid secret at a different session
id returns the same
404as a session that does not exist. The surface cannot be used to discover what else you have. - Closing ends write authority. A closed session permits outcome retrieval
— the retrieve, and a finalize call, which then only reads — until one hour
after its expiry. In that same window a completed session also
accepts a retried zero-total
/complete(which reads the same order) and an/identityattestation (a buyer who paid first and verified after; the sale itself does not move). Other writes and payment credentials return401 invalid_client_secret. - Every authentication failure is one answer. Missing, malformed, wrong,
used outside a closed session’s permitted read/retry window, or an API key
presented by mistake: all
401invalid_client_secret, with noparamand nothing to distinguish them. A valid secret aimed at a session it does not own is the404above, not a401— neither answer tells the caller anything it did not already know.
The reverse also holds: a client secret presented to a keyed endpoint is
401 invalid_api_key. The two planes never authenticate on each other's terms.
Retrieve the session
GET/v1/buyer/checkout_sessions/{id}curl https://tickets.lissen.com/api/v1/buyer/checkout_sessions/{id} \
-H "Authorization: Bearer cs_0199c4e6-..._secret_9Qb1n..."{
"id": "cs_0199c4e6-3a55-7d0e-9f21-4a7c8b2d6e33",
"status": "open",
"currency": "GBP",
"line_items": [
{
"item_id": "itm_0199c4e3-77a2-7e19-b0c5-9d3f2a4e6b10",
"quantity": 2,
"unit_list_price_minor": 1000
}
],
"quote": { "mode": "checkout_quote", "totals": { "total_minor": 2080 } },
"total_minor": 2080,
"booking_fee_minor": 280,
"platform_fee_minor": 280,
"payment_method_types": ["card", "bacs_debit"],
"return_url": "https://acme-events.com/orders/thanks",
"expires_at": "2026-11-02T14:15:11Z"
}This is a different shape, not a filtered copy of the partner one. Your
metadata, the payment references, the hold id and the session's own
credential are absent because the buyer projection has no fields for them —
so a field added to the partner wire tomorrow cannot leak here by omission.
It carries expires_at, which is what a countdown on your page should render,
and the full quote, which is what your order summary should render. Both are the
same values your server sees.
Update the cart
PATCH/v1/buyer/checkout_sessions/{id}curl -X PATCH https://tickets.lissen.com/api/v1/buyer/checkout_sessions/{id} \
-H "Authorization: Bearer cs_0199c4e6-..._secret_9Qb1n..." \
-H "Content-Type: application/json" \
-d '{
"line_items": [
{ "item_id": "itm_0199c4e3-77a2-7e19-b0c5-9d3f2a4e6b10", "quantity": 3 }
]
}'This is the same universal update the keyed plane runs — same locks, same re-quote, same keep-or-refuse growth, same errors. See checkout sessions for what it does; none of that changes because a buyer asked for it.
Three fields: line_items, codes and customer — the last holding only
email and name. A buyer can change the cart, present a discount code and
say who they are. A buyer can never touch your metadata, your return_url or
the customer identity you set.
Refresh the quote
POST/v1/buyer/checkout_sessions/{id}/quotecurl -X POST https://tickets.lissen.com/api/v1/buyer/checkout_sessions/{id}/quote \
-H "Authorization: Bearer cs_0199c4e6-..._secret_9Qb1n..."The universal update with no cart change: it re-prices the cart exactly as it stands and replaces the stored quote with the result. Use it when the price can have moved without the cart moving — a code that just expired, a membership benefit that just became applicable, a door drawing near enough to withdraw a slow payment method.
The refreshed quote is the one the payment is synced to. It returns the same buyer session shape as a retrieve.
Fetch payment credentials
GET/v1/buyer/checkout_sessions/{id}/payment_credentialscurl https://tickets.lissen.com/api/v1/buyer/checkout_sessions/{id}/payment_credentials \
-H "Authorization: Bearer cs_0199c4e6-..._secret_9Qb1n..."{
"payment_intent_client_secret": "pi_3QxAcme...._secret_...",
"connected_account_id": "acct_1QxAcmeTestAccount",
"publishable_key": "pk_test_...",
"payment_method_types": ["card", "bacs_debit"]
}The session must carry the buyer's email first — from your create, or from
the buyer's own update — or this answers 422 buyer_identity_required. The
confirmation and the tickets go to that address, so no money is taken without
it.
Fetch this immediately before confirming, not when the page loads. Every call re-syncs the payment's amount to the session's current quote, which is what guarantees a buyer cannot confirm a total that has since been superseded. It also prepares the payment if the session does not have one yet.
Despite being a GET, this call changes state — it is the one read on
either plane that does. It can prepare a payment, it re-syncs an existing one,
and it can therefore write checkout_session.updated to your activity feed.
Treat it as the action it is, and do not put it on a polling loop.
payment_intent_client_secretconfirms the payment in the browser.connected_account_idis your Stripe account. Charges run directly on it, so Stripe.js must be initialised with it or the secret will not resolve. It isnullwhen your ticket payments are collected on the Lissen platform account (a setting only Lissen makes): initialise Stripe.js without a connected account.publishable_keyis the platform key for this organizer's mode — the one credential here that is meant to be public.payment_method_typesis exactly what the payment form will offer.
It can fail in four ways worth handling separately:
| Status | Code | What to do |
|---|---|---|
422 | connect_account_not_onboardable | The organizer's Stripe account cannot take payments yet. Nothing the buyer can fix — this is a setup problem on your side. |
503 | connect_provider_unavailable | Stripe was unreachable. Retry with backoff. |
422 | payment_intent_unavailable | No usable payment came back. Call this endpoint again — it is the recovery path, and retrieving the session is not. |
409 | checkout_session_not_open | The session is over. Send the buyer back to start again. |
Finalize the payment
POST/v1/buyer/checkout_sessions/{id}/finalizecurl -X POST https://tickets.lissen.com/api/v1/buyer/checkout_sessions/{id}/finalize \
-H "Authorization: Bearer cs_0199c4e6-..._secret_9Qb1n..."Call this the moment Stripe.js tells you the payment went through — the
confirmation resolved with the payment succeeded or processing. The engine
asks Stripe about the session's payment itself and, if the money has moved,
completes the session there and then: the order and the tickets exist when it
answers, rather than when Stripe's webhook reaches the engine a few seconds
later.
It takes no body, and nothing about the request is trusted — the status is only ever Stripe's own answer to the engine — so it is safe to call on any signal and to repeat. It answers the buyer session, exactly as a retrieve does:
| Answer | What it means |
|---|---|
completed, with order_id | The tickets are issued. Show your success screen. |
payment_processing | The money moved but the session cannot complete on this call; the webhook finishes it, which can still be payment_refused with an automatic refund. Keep polling. |
open or payment_pending | Stripe does not yet report the payment as started. Keep polling. |
expired, payment_refused | The session is over, as a retrieve would say. |
A completed session answers at once, without asking Stripe. Finalize never refunds anything and is never the only path: without it, the webhook settles the session all the same and your poll sees it a little later.
Paying, with the Payment Element
The engine deliberately does not use Stripe's own hosted checkout page. What it prepares is a payment you render with Stripe's Payment Element inside your own page, so the cart, the copy and the layout stay yours.
Create the session server-side with your API key, and pass the
client_secret to the browser.
Render your cart from the buyer retrieve, and let the buyer edit it through
the buyer update. Show expires_at as a countdown.
Fetch payment credentials when the buyer commits to paying, and load Stripe.js against the connected account:
const stripe = await loadStripe(
credentials.publishable_key,
credentials.connected_account_id
? { stripeAccount: credentials.connected_account_id }
: undefined,
);
const elements = stripe.elements({
clientSecret: credentials.payment_intent_client_secret,
});
elements.create("payment").mount("#payment-element");Confirm, then call finalize once Stripe.js
reports the payment succeeded or processing, and poll the buyer retrieve
until status is completed, expired or payment_refused. Keep polling through payment_pending and
payment_processing — those are stages of a payment resolving, not answers. The
engine sets the payment method types itself, so the Element renders exactly the
set the session offers and nothing else.
On completed the buyer session carries order_id: the tickets exist, and the
confirmation is on its way to buyer_email. Your success screen summarises —
event, what was bought, what was paid — and says the tickets are in the email;
see orders and positions. On payment_refused the capacity
was gone by the time the money arrived, or the event's
checkout limits no longer
allowed the purchase: nothing was issued and the refund is already automatic.
Say so plainly and send the buyer back to the event.
Once payment starts, the cart is frozen: the buyer update and the quote refresh
both begin refusing with checkout_session_locked, and the session reads
payment_pending, then payment_processing. That is the expected end of a
buyer's editing session, not an error to retry.
If you would rather not build this at all, use the Lissen-served, organizer-branded hosted checkout. It is a plain client of these same endpoints.
Pay with Lissen
Four further buyer-plane operations exist and are not part of a headless integration. They belong to Lissen's own drop-in checkout component, which is the only thing that calls them:
POST/v1/buyer/checkout_sessions/{id}/identity DELETE/v1/buyer/checkout_sessions/{id}/identity POST/v1/buyer/checkout_sessions/{id}/enrolment POST/v1/buyer/checkout_sessions/{id}/wallet/setup POST/v1/buyer/checkout_sessions/{id}/wallet/payThey are how the component takes every payment — a saved card, a new card,
Apple Pay or Google Pay — whether or not the buyer is a Lissen buyer: a card is
entered on a platform SetupIntent, copied onto your connected account and
charged there, so the charge stays direct and your fee schedule, ledger and
settlement are unchanged. The identity side — recognition, the one-time code,
the consent to save a card — is Lissen's, and the engine only ever sees a
five-minute, single-use token bound to one checkout session. Attesting a buyer
sets the session's subject, so a member price or an entitlement keyed to that
person applies from that moment, and withdrawing the attestation (the buyer
takes the chip off, or signs out) returns the subject to anonymous in the same
way, so a stale sign-in never decides whose wallet a card lands in. A buyer
nobody has attested pays as a guest; if they asked to be remembered, the code
comes on the success screen, the card they typed joins their wallet then, and
the customer dossier is claimed for them (customer.updated). An Apple Pay or Google Pay method is
charged the same way but is not promised as a saved, reusable card. The
component confirms the payment either in the browser with Stripe.js or, by
sending confirm: "server" to the pay call, by having the engine confirm it —
the bank's 3-D Secure page is still drawn in the browser when it asks, and a
declined card is answered as payment_declined in the card's own words. The
wallet setup answer names your connected account (connected_account_id), so
the component can make the Radar session that confirmation carries before the
buyer presses Pay.
Nothing here changes a headless integration: the payment-credentials route
and the Payment Element above are unaffected, and the buyer session carries
one extra field — attested_buyer, which is null until somebody is
attested.
If you want Pay with Lissen on your own page, mount the component rather than calling these; they are documented because they are in the contract, not because they are an integration surface. Ask us before building against them.
Where your checkout may be embedded
PATCH/v1/organizerThe component is framed by your site, so your organizer holds the list of
origins allowed to frame it. Set it in your admin under Selling → Embedding,
or send it here. Exact https origins — scheme, host and, if you use one,
port. No path, no trailing slash, no wildcard, and at most twenty:
curl -X PATCH https://tickets.lissen.com/api/v1/organizer \
-H "Authorization: Bearer tk_live_..." \
-H "Ticketing-Organizer: org_..." \
-H "Content-Type: application/json" \
-d '{ "embed_origins": ["https://acme-events.com", "https://shop.acme-events.com"] }'The list is replaced wholesale, so send the whole set you want each time. Empty — the default — means the component cannot be framed anywhere.
Saving the list also attempts to register its domains with Stripe for Apple Pay and Google Pay. The Embedding page shows each wallet's status for each origin and the hosted checkout. Registration can fail without undoing the saved origins: use Register and check to retry, or Check again to refresh the status. A saved origin alone does not mean its wallet buttons are ready.
GET/v1/public/organizers/{slug}/embedThe component's own page reads that list back before it can decide who may
frame it, which is before any session exists — so this one operation takes no
credential at all. It answers the same list, caches for a minute, and discloses
nothing an embedding browser would not learn from the page's own
frame-ancestors header.
Payment-method gating
payment_method_types is derived on every read, never stored, and three filters
decide it in order.
1. Currency. A bank debit is a national rail, and each settles exactly one currency:
| Cart currency | Delayed method offered |
|---|---|
GBP | bacs_debit |
EUR | sepa_debit |
USD | us_bank_account |
2. Your account's capabilities. Only methods your connected account has actually been enabled for survive. If the engine cannot read your capabilities, it offers cards only — an unknown answer is not permission, and a method your account cannot accept renders a form the buyer cannot complete. The engine remembers your capabilities for up to five minutes, so a method Stripe has just enabled can take that long to appear.
3. The clock. Delayed-notification methods can take around four business days to clear, so they are offered only when the cart's earliest door is beyond the clearing window — seven days today, an engine-wide setting. Cards are always offered.
The third rule is why the set narrows on its own. A session opened three weeks before the show can offer BACS; the same cart re-quoted the day before the show cannot, and the payment is updated to match. That is the point: it closes the attend-on-Friday, payment-bounces-on-Monday hole.
Errors
| Code | Status | Type | What it means | What to do |
|---|---|---|---|---|
invalid_client_secret | 401 | authentication_error | The bearer is missing, malformed, wrong, or is used outside a closed session’s permitted operations/window. Outcome retrieval (including /finalize, which then only reads) and an already-completed zero-total /complete retry remain available until one hour after session expiry. Every authentication failure is this one answer with no distinguishing detail, so the endpoint cannot be used to probe which sessions exist. A VALID secret used with another session's id is different: that is a non-enumerating 404, identical to the answer for a session that never existed. | The buyer's session is over. Send them back to start a new checkout. If you are getting a 404 instead, check that the id in the path is the session the secret was issued for. |
| Code | Status | Type | What it means | What to do |
|---|---|---|---|---|
payment_intent_unavailable | 422 | invalid_request_error | The session has no usable payment intent yet. Creation commits the cart, hold and reservations first and creates the intent immediately afterwards, so a create response can legitimately carry empty `psp_refs`. | Retry the payment-credentials endpoint; that is the call that prepares the intent. Retrieving the session does not prepare or recover payment. |
The Pay with Lissen operations add their own, all of which mean "ask the component to start again" rather than anything you can retry blindly:
| Code | Status | Type | What it means | What to do |
|---|---|---|---|---|
identity_token_rejected | 401 | invalid_request_error | The Lissen identity action token was not accepted. The reason is in the message: it was malformed or expired, addressed to another service, minted for another action, bound to a different checkout session, carried an unverified address, or had already been spent. Nothing on the session changed. | Ask the identity component for a fresh token for THIS session and try again. A token is single-use and lives five minutes. |
| Code | Status | Type | What it means | What to do |
|---|---|---|---|---|
reverify_required | 403 | invalid_request_error | The attestation behind this session is older than ninety days, which is the horizon after which a saved card must not pay unattended. | Have the buyer verify their address with Lissen again, attest the session with the fresh token, and repeat the payment. |
| Code | Status | Type | What it means | What to do |
|---|---|---|---|---|
payment_method_not_owned | 403 | invalid_request_error | The named payment method is not this buyer's. The same answer is given whether it belongs to somebody else or to nobody the engine knows. | Use a card from the buyer's own saved list, or enter a new one through the wallet setup call. |
| Code | Status | Type | What it means | What to do |
|---|---|---|---|---|
payment_declined | 422 | invalid_request_error | The engine charged the card and the card refused it: on a pay call that asked for engine confirmation, or on a membership join that named a saved card. `message` is the card's reason, written for the buyer; `detail.decline_code` is the card network's code when there is one. Nothing started: a checkout session is still open, and a join created nothing. | Show the message where the buyer pays and let them choose another card or enter a new one. Do not retry the same card unchanged. |
Everything else you will see here is the same code the keyed plane returns for
the same situation — insufficient_capacity (422) on a growth that does not
fit, checkout_session_locked (409) once payment has started,
checkout_session_conflict (409) when two updates race, capacity_locked
(409) under contention. Handle them the same way, and remember they are being
rendered to a person: insufficient_capacity means the cart is unchanged and
you should say so.
What emits
Buyer actions emit exactly the activities the keyed equivalents do —
checkout_session.updated, and hold.updated when the footprint moved. The
difference is the actor: a buyer is not an API key, so the activity records the
engine acting for a named session rather than a principal that does not exist.
{ "kind": "system", "id": "checkout_session:cs_0199c4e6-3a55-7d0e-9f21-4a7c8b2d6e33" }Filtering the feed on that actor id gives you every change a given buyer made.
It also names the session's issuance when a finalize call completed it
(order.created, position.created, checkout_session.completed); when the
Stripe webhook completed it, those carry the psp_webhook actor instead. The
order and its activities are the same either way, and emitted once.
Retrieving a session emits nothing, so a browser polling one does not fill your
feed. Fetching payment credentials is the exception noted above: it can write a
checkout_session.updated, because it can change the payment. Finalize emits
only when it changes the session — the issuance above, or a
checkout_session.updated marking a payment in flight — and a repeat emits
nothing.
Gotchas
- Never ship an API key to a browser. This credential exists so you do not have to.
- Capture
client_secretfrom the create response, or be prepared to replay the create with the same key. There is no other endpoint that will give it to you. - Fetch payment credentials late. Fetching at page load and confirming ten minutes later is how a buyer confirms a stale total — the engine re-syncs on that call precisely so you do not have to think about it.
- Initialise Stripe.js with
connected_account_id. Charges are direct; without it the payment secret will not resolve. When it isnull, the payment is on the platform account and Stripe.js takes no account. - Do not send
Ticketing-OrganizerorIdempotency-Key. The first is pointless, the second is a400. - A
404here means "not your session" — it is the same answer as "no such session", on purpose.
For free admission, use zero-total completion instead of payment credentials.
Test and live saved cards
The wallet stores a separate platform Customer for each Lissen user and Stripe mode. Setup, pay, saved-card lookup and guest-card binding use the checkout organizer's mode. A card saved with a test organizer is available only in test mode. On the first live purchase the buyer enters a card once; with card-reuse consent, that card can be reused with live organizers. Test cards and saved payment methods are never transferred to the live Customer.