React checkout
Checkout spine
`CheckoutSpineRoot` is the full buyer purchase flow for **partner embed**. Mount it once. The SDK owns the phase drawers (3 to 6).
axyn.events is AXYN-operated checkout using TicketPanel
internally. Do not copy ShopEventTicketPanel as a partner quickstart. Hosted
venues link out. See Choose a path.
What it mounts
- Event page — hero + Get tickets CTA (
EventPage) - Phase 3 — inventory
- General admission:
TierSelectionDrawer(tier + quantity) - Reserved seat:
SeatSelectionDrawerwhenevent.ticketing_layout_mode === 'reserved_seat'and you passseatCatalog(see Seats)
- General admission:
- Phase 4 — add-ons —
AddOnSelectionDrawerwhen the event has add-ons or bundles; otherwise skipped (phase4_not_applicableanalytics) - Phase 5 — review —
CheckoutSummaryDrawer→POST /v1/orders(atomic reservation) - Phase 6 — pay —
CheckoutPaymentDrawer(Stripe via AXYN client secret) - Host handoff — your
onPaymentCompleteruns after pay succeeds
Root vs content
| Export | Role |
|---|---|
CheckoutSpineRoot | Wraps CheckoutSessionProvider + spine content. Use this. |
| Spine drawers | Part of the root mount — not a separate public entrypoint |
CheckoutSpineRoot also needs api: AxynApiClient and optional initialDraft.
Props (required)
Documented in Quickstart. Summary:
- Catalog:
event,tiers,addOns,bundles - Host:
orgSlug,api,stripePublishableKey - Navigation:
buildPaymentReturnUrl,onPaymentComplete
Optional:
| Prop | Default | Notes |
|---|---|---|
showPoweredByAxyn | false | Show Powered by AXYN footer (aggregators often require this) |
seatCatalog | null | Required for reserved-seat events |
initialDraft | none | Seed checkout draft |
Reservation model (do not invent)
There is no separate “reserve tier inventory” call for GA.
| Step | Server |
|---|---|
| Tier / qty (GA) | Client draft only |
| Seat select | POST /v1/seats/hold (when seated) |
| Add-ons | Client draft; preview-total for live price |
| Coupon codes | Optional coupon_codes on preview-total + POST /v1/orders |
| Review → Place | POST /v1/orders creates reserved order + payment client secret |
| Pay | Confirm Stripe PI → verify-payment |
Totals must come from AXYN preview / order responses. Do not invent client-side totals.
Coupons
The review step renders a CouponCodeField under the order summary
in the embed drawer. Applying a code calls
actions.applyCoupon(code), which re-prices through preview-total with
coupon_codes; the preview response echoes coupon_codes and carries
discount_cents, and OrderSummary shows the negative Discount line.
actions.removeCoupon(code) drops one. The same coupon_codes array rides
POST /v1/orders, where the server re-validates every coupon and
increments its redemption counters atomically — if a code was consumed
between preview and place (coupon_exhausted etc.), the SDK drops the
codes, re-prices without them, and surfaces the reason in
state.couponError.
One coupon per checkout by default. When every ticket tier in the cart has
allow_multiple_coupons (organizer per-tier opt-in, default off), buyers
may stack distinct codes: allocations run in entry order against the
combined cap min(95% of ticket subtotal, subtotal − $5), duplicates
reject with coupon_duplicate, and stacking against an opted-out tier
rejects with coupon_stacking_not_allowed. Mount
<CouponCodeField allowMultiple /> when the selected tier opts in (the
built-in surfaces do this automatically).
Names for every ticket
When the event's attendee_details_mode is required, the review step
shows one block per ticket under the buyer's name and email: heading "Who is
this ticket for?", then first name, last name and an optional email for each
ticket, and the notice "Add an email to send someone their pass. Without
one, the pass stays with you. The organizer sees these names and emails."
Add-ons get no block. When the mode is off or absent the
step is unchanged and nothing extra is sent.
- The first block starts from the buyer's own name and stays editable. Its email starts blank. Other blocks start empty.
- First and last name are required. A blank email is valid and is left out of the entry; that pass stays with the buyer. A typed email must be valid, and that person also gets their pass by email.
- The buyer always holds every pass of the order and can transfer one later. The confirmation screen shows each pass with its attendee's name, and the line "Also sent by email to ..." when some passes also went to other emails.
- Changing the quantity adds empty blocks at the end or removes blocks from the end. Earlier blocks keep their values.
- Place order is refused until every block is valid. Each invalid field shows its own message and focus moves to the first one.
- The session sends
attendeesonPOST /v1/ordersand keeps the values for a payment retry. attendee_details_requiredandattendee_details_invalidfrom the server land instate.lastErroras the server's sentence.
CheckoutSpineRoot reads the setting from the event you pass. If you mount
CheckoutSessionProvider yourself, put it in the checkout event:
<CheckoutSessionProvider
api={api}
event={{
venueId,
venueEventId: event.id,
attendeeDetailsMode: event.attendee_details_mode,
ticketTiers: tiers,
// Series: which shows and pass types ask for it.
...seriesAttendeeDetailsRules(series),
}}
>
To build your own fields, use useAttendeeDetails() (blocks, values, inline
errors, validate()) with <AttendeeDetailsFields />, or the pure helpers
resolveAttendeeSlots, resolveAttendees, validateAttendees and
actions.setAttendee(key, patch). Wire contract and the notice API-only
checkouts must show: Headless API.
Credentials
- Never put tenant secret API keys in the browser.
- Catalog loads should use a server-side catalog key (or SSR).
- Checkout / payment use the buyer JWT (anonymous or signed-in), not
x-api-keyon the client.
Host responsibilities
You own:
- Loading catalog (
event/ tiers / add-ons / bundles) - Building the Stripe return URL (
buildPaymentReturnUrl) - Post-pay navigation (
onPaymentComplete→ confirmation / tickets) - Optional:
seatCatalogfor reserved-seat events - Optional: brand / Powered by AXYN via
AxynProvider+showPoweredByAxyn
Aggregators
Same spine for multi-venue embeds. Branding and Powered by AXYN policy:
Theming. Go-live for aggregators is white-glove — portal
/aggregators.