Checkout sessions
Open a cart that holds capacity, change it with one call, and hand it to a buyer to pay
A checkout session is the transactional heart of the engine. Creating one does four things in a single transaction — either all four happen or none do:
- Holds the capacity. Every quota your line items draw on is locked, and the units are taken out of circulation for the life of the session.
- Takes the binding quote. Prices, discounts, membership effects and your fee schedule are resolved once, and the result is what the buyer will pay.
- Reserves the consumables the quote spends. A "first 100 buyers" code is reserved at this moment, not at payment — which is what stops a hundred open carts from all thinking they got it.
- Mints the buyer's credential — a bearer scoped to this one session.
Once that has committed, a non-zero quote prepares payment on your connected
Stripe account. That step sits outside the transaction, so a session is
valid whether or not it succeeded — see psp_refs below.
Everything on this page is done with your API key and the
Ticketing-Organizer header. Your buyer's browser gets a
much weaker credential and a much smaller
surface.
Create a session
POST/v1/checkout_sessionsIdempotency-Key is required here, and the request is refused without
one. A duplicate create consumes capacity — two calls, two holds, two carts —
so there is no safe default the engine could pick for you.
curl -X POST https://tickets.lissen.com/api/v1/checkout_sessions \
-H "Authorization: Bearer tk_test_..." \
-H "Ticketing-Organizer: org_0199c4e2-1f7a-7c31-8d44-2b9f6a1e05c7" \
-H "Idempotency-Key: 7c1f0a3e-4d29-4f81-9b6b-1e2a5c8d0f44" \
-H "Content-Type: application/json" \
-d '{
"line_items": [
{ "item_id": "itm_0199c4e3-77a2-7e19-b0c5-9d3f2a4e6b10", "quantity": 2 }
],
"codes": ["SUMMER10"],
"return_url": "https://acme-events.com/orders/thanks",
"metadata": { "basket_ref": "b_8891" }
}'| Field | Notes |
|---|---|
line_items | Required. 1–50 lines, each item_id plus a quantity of 1–100. An item with a max_per_order caps its line lower: asking for more is refused with quantity_limit_exceeded, and the limit is in the error detail. An approval-gated item (requires_approval) is refused with item_not_sellable; it is sold through its waitlist. |
codes | Up to 10 codes the buyer presented. A code that does not apply is not an error — it comes back under quote.rejected_codes with a reason. |
offer | Optional. A price your own backend decided for this checkout only — an affiliate or invitation offer — applied without the buyer typing anything. See offers from your backend. |
customer | Who is buying. id or external_ref is your own identifier for the buyer and makes the cart authenticated for entitlements; email (with an optional name and phone) is the buyer's contact, which mints or refreshes their customer record and is where the order confirmation goes. phone is optional and nullable, kept as typed (digits, spaces, (), - and a leading +, 7–25 characters with at least five digits), never verified, and copied to the order as buyer_phone. Give at least the email before payment; omit the whole field for an anonymous cart you will identify later. |
return_url | Where the buyer goes after paying. Nullable. |
metadata | Yours. Stored, echoed, never read by the engine. |
The 201 carries the whole session, the buyer's credential, and the hosted URL:
{
"id": "cs_0199c4e6-3a55-7d0e-9f21-4a7c8b2d6e33",
"status": "open",
"created": "2026-11-02T14:05:11Z",
"customer_id": null,
"currency": "GBP",
"line_items": [
{
"item_id": "itm_0199c4e3-77a2-7e19-b0c5-9d3f2a4e6b10",
"quantity": 2,
"unit_list_price_minor": 1000
}
],
"quote": {
"mode": "checkout_quote",
"currency": "GBP",
"totals": {
"list_subtotal_minor": 2000,
"discount_minor": 200,
"subtotal_minor": 1800,
"booking_fee_minor": 280,
"platform_fee_minor": 280,
"total_minor": 2080
},
"rejected_codes": [],
"degraded": false
},
"total_minor": 2080,
"booking_fee_minor": 280,
"platform_fee_minor": 280,
"payment_method_types": ["card", "bacs_debit"],
"hold_id": "hld_0199c4e6-3a58-7b12-8c40-1d9e5f3a7b28",
"hosted_url": "https://tickets.lissen.com/checkout/acme-events",
"return_url": "https://acme-events.com/orders/thanks",
"psp_refs": {},
"locked_at": null,
"expires_at": "2026-11-02T14:15:11Z",
"completed_at": null,
"metadata": { "basket_ref": "b_8891" },
"client_secret": "cs_0199c4e6-3a55-7d0e-9f21-4a7c8b2d6e33_secret_9Qb1n…",
"url": "https://tickets.lissen.com/checkout/acme-events#cs_0199c4e6-3a55-7d0e-9f21-4a7c8b2d6e33_secret_9Qb1n…"
}The quote is trimmed above; in full it also carries subject, per-line
line_items, applied_effects, unapplied_effects,
superseded_effect_ids and degraded_providers. Its shape is the same one
POST/v1/quotes returns, so a preview you rendered
on your event page and the binding quote on the session are read by the same
code.
Two fields you get on a create and nowhere else
client_secretis the buyer's credential for this session. It is returned by this call and by no other: not a retrieve, not a list, and never an activity payload.urlis the same hosted page ashosted_url, with the client secret in the URL fragment. A fragment never reaches a server log or aRefererheader, which is why it is the only place the secret rides in a URL.
Retrying this request with the same Idempotency-Key returns the identical
response body, both of those fields included, marked with an
Idempotent-Replayed: true header. (The headers are the only difference: that
marker, and a fresh Request-Id naming the retry rather than the original.) A
replay does no work — no second cart, no second payment, and nothing on the
activity feed. A retry that lost its answer to a timeout is therefore a complete
answer, not a half one.
That holds for as long as the session is open. Once the session reaches a
terminal state the same key answers 409 checkout_session_not_open: the
session is over, and its credential can no longer be recovered from anywhere.
Create a new one.
psp_refs can be empty on a create
A create response carries "psp_refs": {}. The cart, the hold and the
reservations are already durable at that point; the payment is prepared
immediately afterwards, and the references appear on the session once it is.
Retrieve the session a moment later and they are usually there.
If that preparation did not succeed, nothing has gone wrong with the session either — the capacity is held and the quote is binding regardless. Fetching payment credentials prepares the payment if it has not been prepared yet, so the buyer's own next step is also the recovery path. At most one payment ever exists for a session, however many times you retry the create or fetch credentials.
One cart, one currency
Every item in a cart must share a currency. The engine performs no FX, so a
mixed cart is refused with currency_mismatch before anything is held.
Offers from your backend
An affiliate link or an invitation often carries a price only you know: you
decided it, and it should apply to one buyer's checkout without a code to share
or leak. Send it as offer when you create the session. One call creates the
checkout and prices it; there is no separate discount to create first.
curl -X POST https://tickets.lissen.com/api/v1/checkout_sessions \
-H "Authorization: Bearer tk_test_..." \
-H "Ticketing-Organizer: org_0199c4e2-1f7a-7c31-8d44-2b9f6a1e05c7" \
-H "Idempotency-Key: 2b8e4c10-93d7-4a5e-8f31-6c0a9d7e1b52" \
-H "Content-Type: application/json" \
-d '{
"line_items": [
{ "item_id": "itm_0199c4e3-77a2-7e19-b0c5-9d3f2a4e6b10", "quantity": 1 }
],
"customer": { "external_ref": "user_8812", "email": "ana@example.com" },
"offer": {
"effect_type": "price_override",
"amount_minor": 1500,
"amount_currency": "GBP",
"label": "Invitation from Sam",
"reference": "aff_sam_42"
}
}'The offer uses the effect vocabulary of a discount code:
| Field | Notes |
|---|---|
effect_type | percent (percent_bps off each ticket), amount (amount_minor off each ticket) or price_override (each ticket sold at amount_minor; zero is free entry). |
amount_minor, amount_currency | For amount and price_override. The currency must be the cart's. |
item_ids, event_ids | Optional scope, with a code's union semantics; both empty means every line. |
label | What the buyer sees on the effect line. |
reference | Your own handle for the offer, such as an affiliate or invitation id. |
The engine validates and prices it with the same quote that prices everything
else, so fees, rounding, the binding quote and a zero total behave exactly as
they do for a code. You never send a total: you send the offer, and the engine
computes what is payable. The quote's applied_effects carries it with
source.kind checkout_offer, your label and your reference as
source.ref, which is what you reconcile on, and the creation activity carries
the same quote. Catalog prices do not change; the offer exists on this session
and nowhere else.
- Best price wins against membership. For a member, the lower of the offer
price and the member price applies — never both. With a list price of £20, a
member price of £16 and an offer price of £15, the buyer pays £15, not £12; with
an offer at £17 they pay £16 and the offer is reported in
superseded_effect_ids. See how the offer and membership compete. - An ordinary code still works beside it, under the usual stacking rules. The offer is kept across cart edits, so removing a ticket does not lose it.
- Only your API key can attach one. The buyer's credential cannot set, replace or remove an offer, and neither can a later update from you: it is fixed when the session is created.
- Retries are safe. The same
Idempotency-Keywith the same body replays the one session. The same key with a different offer isidempotency_key_reused. - An offer that cannot apply is refused, not ignored. One that covers none of
the cart's items, or is priced in another currency, returns
422checkout_offer_not_applicableand creates nothing. Create the session without anofferto fall back to the catalog and membership price.
Deciding who gets an offer, generating the link and calculating any commission are yours; the engine only prices the checkout you describe.
The universal update
PATCH/v1/checkout_sessions/{id}Quantity changes, added lines, removed lines, a newly presented discount code and a plain re-price are all this one call. There is no add-line endpoint and no remove-line endpoint.
curl -X PATCH https://tickets.lissen.com/api/v1/checkout_sessions/{id} \
-H "Authorization: Bearer tk_test_..." \
-H "Ticketing-Organizer: org_0199c4e2-1f7a-7c31-8d44-2b9f6a1e05c7" \
-H "Content-Type: application/json" \
-d '{
"line_items": [
{ "item_id": "itm_0199c4e3-77a2-7e19-b0c5-9d3f2a4e6b10", "quantity": 3 }
]
}'line_items states the whole new cart, never a delta. Send the three lines
you want, not the one you are adding. Send at least one line — an empty cart is
not a valid update, and the way to end a session is to expire it.
codes, customer, return_url and metadata may each be sent on their own
or together; at least one field is required. Anything you omit is left as it was
— including the codes, which are re-priced against the new cart every time.
customer.email is the one field the buyer can also set from their side, on
the buyer plane. Payment credentials are refused
with buyer_identity_required until the session has one: an order needs
somewhere to go.
One update, one transaction: the hold is adjusted, the quote is re-run, the reservations are re-taken, and the payment amount is amended in place. The session's id and its Stripe identity never change.
Idempotency-Key is optional here. A repeated cart edit is not a duplicate
purchase, so the engine does not insist — but send one if you want replay
semantics.
Growth is keep-or-refuse; shrink frees
This is the property to design your UI around.
- Shrinking always works. The difference is returned to the pool in the same commit, and someone else can buy it immediately.
- Growing is atomic keep-or-refuse. The engine re-decides the whole new
footprint under the capacity lock. If it does not fit, the update is refused
with
insufficient_capacityand your existing hold stands untouched. A buyer who asks for one ticket too many keeps the ones they already had.
The engine never releases your hold in order to try for a bigger one. If it did, a buyer nudging 2 up to 6 on a nearly sold-out show would lose their two seats to whoever was waiting on the lock.
Because a refused growth writes nothing, it also emits nothing — you will not
see a checkout_session.updated for an attempt that changed no state.
Re-pricing without changing the cart
Prices move for reasons other than the cart: a code expires, a membership
becomes applicable, the door gets close enough to withdraw a slow payment
method. Sending the current line_items back to this endpoint re-runs the quote
against them.
Buyers do this constantly, so the buyer plane has a dedicated refresh-quote call for exactly this — the same update, with no cart change.
Event checkout limits
An event can set a per-order minimum and maximum and a per-customer cap
(min_tickets_per_order, max_tickets_per_order, max_tickets_per_customer;
see checkout limits). The engine
enforces them on the session, whichever client started it, so bounding your
quantity controls is a courtesy to the buyer rather than the enforcement.
Each line's event on the buyer plane carries
all three as they apply to that checkout, null where none applies: a waitlist
invitation, which is exempt from the minimum, shows no minimum. The engine
checks every cart an update submits, so a buyer whose cart is several tickets
outside changed limits needs the corrected cart sent in one update, not one
ticket at a time.
What counts
- A checkout's count for an event is the sum of the quantities of its lines whose item belongs to that event. The limits apply across the event's items together, not to each item: under a maximum of four, two standard and two VIP tickets is four. An item with no event, and another event's items, never count; a cart that mixes events is checked per event.
- A purchaser's count is per customer, the checkout session's customer, who becomes the order's customer: their live tickets for the event from earlier orders, plus the tickets in their other open checkouts that still hold capacity. With a cap of five, a customer who bought two may buy at most three more, in one checkout or several.
- What gives allowance back: a checkout that expires, is expired, or whose hold lapses; and a ticket that is revoked, as a position refund, a dispute or a failed payment revokes it. Completing a checkout does not: its held tickets become purchased tickets, which go on counting.
- What does not: transferring a ticket to someone else, because the cap is about who bought, not who holds; and a money-only refund that leaves the ticket live. A comp's tickets count toward its recipient's cap like any other order's, although the comp itself is never refused.
The customer is the organizer's customer record. A guest checking out by email is one customer per email address; the cap does not claim to identify one person across addresses.
When it is checked
| Moment | Per-order minimum and maximum | Per-customer cap |
|---|---|---|
| Create | Always | When the session names a customer |
| Update that changes the lines | Yes | Yes, when the session has a customer |
| Update that sets or changes the customer, including the buyer's email and an identity attestation | No | Yes |
| Refresh or any update that changes neither | No | No |
| Completion, free or paid | Yes | Yes |
A refused create or update changes nothing, like a refused capacity growth: the existing cart stands. One purchaser's checkouts for one event are decided one at a time, so two concurrent checkouts cannot both fit a cap only one of them fits.
Completion re-checks against the event's current limits. Limits can
tighten, and a customer can buy elsewhere or receive a comp, while a checkout is
open. A free completion is then refused and nothing is issued; the buyer can
change the cart and complete again. A paid completion cannot be refused
without taking the money back, so the payment is refunded in full, fee
included, and the session closes as payment_refused, as it does when the
capacity is gone. The engine records the refusal on the still-open session,
as psp_refs.refused_reason with a checkout_session.updated, before it asks
for the refund; from then on the session is refused whatever happens next,
even if allowance or capacity comes back before the refund lands.
A waitlist invitation holds exactly one ticket, fixed by the promotion, so it is exempt from the per-order minimum. The maximum and the cap still apply: promotion refuses an invitee already at the cap before it reserves the ticket, and the cap is checked again when the buyer names themselves and at completion.
Refusals
Each checkout-session refusal is 422 with param: "line_items" and a
detail naming the event and the limit, so a client can offer a quantity that
fits. A waitlist promotion refused at the cap carries the same code and
detail with param: "id":
{
"error": {
"type": "invalid_request_error",
"code": "customer_ticket_limit_exceeded",
"message": "This event allows at most 5 tickets per customer; this customer can buy 3 more",
"param": "line_items",
"detail": { "event_id": "evt_…", "limit": 5, "quantity": 4, "remaining": 3 }
}
}detail.quantity is this checkout's count for the event; detail.remaining
(the cap only) is how many more the customer may buy, never negative. The
message is written so the hosted checkout can show it to the buyer as it is;
build your own wording from detail if you need the event's name in it.
| Code | Status | Type | What it means | What to do |
|---|---|---|---|---|
order_quantity_below_minimum | 422 | invalid_request_error | The checkout has fewer of one event's tickets than the event's `min_tickets_per_order`, counted across all of that event's items in the checkout. `detail.event_id` names the event, `detail.limit` the minimum and `detail.quantity` this checkout's count. Nothing changed; a refused update leaves the existing cart as it was. | Add tickets for that event until the checkout reaches `detail.limit`. The event's `min_tickets_per_order` is on the Event and on the buyer plane's `line_items[].event`, so a checkout can bound its quantity controls first. |
order_quantity_above_maximum | 422 | invalid_request_error | The checkout has more of one event's tickets than the event's `max_tickets_per_order`, counted across all of that event's items in the checkout. `detail.event_id` names the event, `detail.limit` the maximum and `detail.quantity` this checkout's count. Nothing changed; a refused update leaves the existing cart as it was. | Reduce the event's tickets to at most `detail.limit` in this checkout. Splitting them across checkouts does not help when the event also caps tickets per customer. |
customer_ticket_limit_exceeded | 422 | invalid_request_error | The purchaser (the checkout's customer, who becomes the order customer) would hold more of one event's tickets than its `max_tickets_per_customer`. Their live tickets from earlier orders and the tickets in their other open checkouts count; tickets they transferred away still count. `detail.remaining` is how many more they may buy. At buyer completion nothing is issued; in paid settlement the payment is refunded in full and the session closes as `payment_refused`. | Offer at most `detail.remaining` tickets for that event, or none when it is zero. Allowance comes back only when the purchaser's other open checkouts expire or are released, or when their tickets are revoked. Completing another checkout does not: its held tickets become purchased tickets, which keep counting. A transfer or a money-only refund does not give allowance back either. |
A paid session refused at settlement records the same code as
psp_refs.refused_reason, and the refund carries it as lissen_refusal in
its Stripe metadata.
Expire a session
POST/v1/checkout_sessions/{id}/expirecurl -X POST https://tickets.lissen.com/api/v1/checkout_sessions/{id}/expire \
-H "Authorization: Bearer tk_test_..." \
-H "Ticketing-Organizer: org_0199c4e2-1f7a-7c31-8d44-2b9f6a1e05c7"Releases the hold now rather than at its expiry, releases the discount-code reservations it held, and cancels the payment. It is idempotent: a session that is already expired or completed is returned unchanged.
Call it when a buyer abandons a basket — the capacity goes back on sale immediately instead of sitting out the rest of the clock.
A payment in flight beats an expiry. If the engine finds money already
moving, expiry releases nothing — the hold stays live, the reservations stay
reserved, and the session reads payment_processing. Freeing capacity
underneath a buyer who has paid is how somebody ends up with no ticket.
You do not have to call this to avoid overselling. A session that nobody expires lapses on its own when its hold does, and the capacity returns then.
Read sessions
GET/v1/checkout_sessions/{id} returns one session. GET/v1/checkout_sessions lists them, keyset-paginated in reverse-chronological order like every other list.
curl "https://tickets.lissen.com/api/v1/checkout_sessions?status=open&limit=50" \
-H "Authorization: Bearer tk_test_..." \
-H "Ticketing-Organizer: org_0199c4e2-1f7a-7c31-8d44-2b9f6a1e05c7"The status filter takes open, completed, expired or payment_refused.
It filters on the stored status, so payment_pending and payment_processing
are not filter values — they are readings of an open session, and both are
returned by status=open.
States
open ──▶ payment_pending ──▶ payment_processing ──┬──▶ completed
│ └──▶ payment_refused
├──▶ expired| Status | What it means |
|---|---|
open | The cart is live and editable. Capacity is held; the quote is binding. |
payment_pending | The buyer has started paying. The cart is frozen from here — the quote is contractual, and every write is refused. |
payment_processing | The engine has seen the money actually move. This is the state that outranks expiry. |
completed | Payment succeeded and the tickets have been issued — see orders and positions. |
expired | Ended without completing. The hold and the reservations were released. Terminal — a session cannot be revived. |
payment_refused | Money arrived for capacity that was gone, or for a checkout the event's checkout limits refused at completion, so the sale was refused and refunded in full. |
The lock is decided on Stripe's answer, not on a flag the engine set
hopefully: before every write the engine asks whether payment has started, and
records the fact if it has. locked_at on the session is that record.
How long a session lives
expires_at is the session's clock and it is exactly the hold's clock — the
session cannot outlive the capacity behind it. It is ten minutes from creation
today, an engine-wide setting rather than a per-request one. Read expires_at
rather than assuming the number.
An update does not extend it. A buyer who spends twelve minutes deciding loses the hold, whatever they clicked in the meantime.
What happens at payment
The buyer confirms the payment in their browser with the credentials the
buyer plane hands them. The session then moves
to payment_pending and on to payment_processing, and the cart stops moving.
The engine learns the payment was accepted from whichever comes first: the buyer's page calling finalize as soon as Stripe.js confirms it, or Stripe's own event. Either way it asks Stripe itself and completes the session once.
Issuance is optimistic. The engine issues the moment a payment is accepted, without waiting for the money to settle: a buyer paying by a slow method holds a valid ticket rather than sitting in limbo, and a payment that later fails revokes it and returns the capacity. What is issued, and what happens when the capacity is gone by the time the money arrives, is in orders and positions.
The completed and payment-refused outcomes are recorded on the activity feed; successful completion also creates the order, positions and admission codes described in orders and positions.
Payment milestones
A session also records the buyer's payment attempts, in its psp_refs,
each with its own activity in the same write:
| Key | What it says | Activity |
|---|---|---|
payment_started_at | When the buyer began paying: the engine confirmed a saved card, the bank asked for 3-D Secure, a card was declined, or the money moved, whichever the engine saw first. Set once. | checkout_session.payment_started |
payment_action_required_at | When the bank first asked for 3-D Secure. Later requests change nothing. | checkout_session.payment_action_required |
payment_decline_count | How many declines the session has seen. | — |
payment_declines | The declines, newest 20 kept: { sequence, code, at }. sequence counts from 1; code is the card's decline reason, such as insufficient_funds, or null. | One checkout_session.payment_declined per entry |
What to rely on:
- Times are the engine's clock, RFC 3339, taken when the engine accepted
the fact. They are not Stripe's event times, and
sequenceis the order the engine accepted the declines in, not the order Stripe created them. - A decline does not end the session. It stays
openfor another card; the session ends as before, ascompleted,expiredorpayment_refused. None of these keys changesstatusorlocked_at. - The count is never cut; the list keeps the newest 20. A redelivered Stripe event is counted once while it remains among the newest 20 accepted declines; an older event replayed after that window can be counted again.
- A late signal is dropped. A 3-D Secure request or a decline that arrives after the engine saw the money move, after a refusal was decided, or for a payment the session no longer uses is not recorded.
- Fetching payment credentials is not a start. A buyer who opens the
payment form and leaves has no
payment_started_at. - A decline the engine's own confirmation answers with
422 payment_declinedis counted once, from Stripe's notification, like any other.
Polling a session to its end
Poll GET/v1/checkout_sessions/{id} until status
is one of completed, expired or payment_refused. Keep polling through
payment_pending and payment_processing — both are intermediate readings of a
session that is still resolving, not answers. Neither is a reason to retry a
write, and neither is terminal.
The hosted page
Every read of a session carries hosted_url — the reserved address of the
checkout page for this session, without the secret:
https://tickets.lissen.com/checkout/acme-eventsThe slug is your organizer's, fixed at onboarding. Only the create response's
url carries the credential, in the fragment. That split is deliberate:
hosted_url is published into the activity stream and into each subsequent
webhook delivery, and one field carrying the secret would scatter a live
credential through your logs.
The page is hosted checkout. The shape above
is stable, so you can either send the returned url to your buyer or build a
headless client against the buyer plane.
Errors
| Code | Status | Type | What it means | What to do |
|---|---|---|---|---|
checkout_session_not_open | 409 | invalid_request_error | The session is no longer open — completed, expired, refused, or its hold is no longer live. | Read the session to see which. An expired session cannot be revived; create a new one. |
checkout_session_locked | 409 | invalid_request_error | Payment has started on this session, so the cart and its quote are contractual and can no longer be changed. | Do not retry the update. Poll the session until it reaches a terminal state. |
checkout_session_conflict | 409 | invalid_request_error | Two updates of the same session raced, or the session moved while its payment was being prepared. Loud and retryable, rather than a silent partial adjustment. | Re-read the session, decide the cart you want from what you now see, and send the update again. |
Beyond those, the ones you will meet on a busy on-sale:
insufficient_capacity(422) — there is genuinely not enough room, decided inside the lock. On an update, nothing was changed.capacity_locked(409) — contention, not a refusal. Another transaction held the lock and the wait timed out; nobody took the tickets. Retry with a short backoff.currency_mismatch(400) — the cart mixed currencies.item_not_sellable(422) — the item is inactive, outside its sale window, or gated with no unlock applied. Quote the cart to see which.order_quantity_below_minimum,order_quantity_above_maximumandcustomer_ticket_limit_exceeded(422) — an event's checkout limits.detailsays which event, which limit and, for the cap, how many more the customer may buy.checkout_offer_not_applicable(422) — on create only: theoffercovers no line in the cart or is priced in another currency. Nothing was created.code_not_reservable(422) — rare. A presented code that runs out mid-cart is normally not an error at all: the cart is re-priced without it and the code comes back underquote.rejected_codeswith a reason you can show the buyer. This code is the residue — a code that still could not be reserved even after that re-price.
The full registry is on the errors reference.
What emits
| You call | The feed records |
|---|---|
| Create | checkout_session.created and hold.created |
| Update that changed the cart | checkout_session.updated, plus hold.updated when the capacity footprint moved |
| Update that only re-priced | checkout_session.updated — no hold activity, because no capacity moved |
| Update that was refused | nothing at all |
| Expire | checkout_session.expired and hold.updated |
| A session timing out on its own | checkout_session.expired and hold.updated — the same pair an explicit expire writes |
| The buyer beginning to pay, the bank asking for 3-D Secure, a card declined | checkout_session.updated, then checkout_session.payment_started, .payment_action_required or .payment_declined for each payment milestone the write added |
| A payment completing | order.created, one position.created per unit, then checkout_session.completed — all in the completion transaction, with checkout_session.payment_started before the completion when nothing earlier recorded the start. See orders and positions |
hold.lapsed is not part of a checkout's life. A checkout hold is released when
its session ends, so by the time the clock catches up there is nothing left to
lapse; the type exists for holds that belong to no session, like a
waitlist invitation.
An idempotent replay does no work, so it emits nothing either — a feed consumer never sees a duplicate from your retry loop. See the activity stream.
Gotchas
line_itemsis the whole cart. The most common integration bug is sending the delta.- A retry replays everything, until it does not. The same key returns the
identical create response while the session is open, and
409checkout_session_not_openonce it has closed. psp_refscan be empty on create. Do not treat it as a failure, and do not gate the buyer on it — fetching payment credentials prepares the payment if it is not there.- Limits count the event, not the item. Splitting tickets across items, lines or checkouts does not get past a maximum or a cap, and a transfer never gives a purchaser allowance back.
- A refused growth leaves the old cart in place. Re-read the session before telling the buyer what they have.
payment_pendingmeans stop editing. Poll through it tocompleted,expiredorpayment_refused; do not retry the update.- The buyer can change the cart too. If you hand a client secret to a browser, that browser can update line items. Your server's view of the cart is a cache — the session is the truth.
A zero-total quote uses payment-free completion.