Skip to content

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

  1. Event page — hero + Get tickets CTA (EventPage)
  2. Phase 3 — inventory
    • General admission: TierSelectionDrawer (tier + quantity)
    • Reserved seat: SeatSelectionDrawer when event.ticketing_layout_mode === 'reserved_seat' and you pass seatCatalog (see Seats)
  3. Phase 4 — add-ons — AddOnSelectionDrawer when the event has add-ons or bundles; otherwise skipped (phase4_not_applicable analytics)
  4. Phase 5 — review — CheckoutSummaryDrawer → POST /v1/orders (atomic reservation)
  5. Phase 6 — pay — CheckoutPaymentDrawer (Stripe via AXYN client secret)
  6. Host handoff — your onPaymentComplete runs after pay succeeds

Root vs content

ExportRole
CheckoutSpineRootWraps CheckoutSessionProvider + spine content. Use this.
Spine drawersPart 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:

PropDefaultNotes
showPoweredByAxynfalseShow Powered by AXYN footer (aggregators often require this)
seatCatalognullRequired for reserved-seat events
initialDraftnoneSeed checkout draft

Reservation model (do not invent)

There is no separate “reserve tier inventory” call for GA.

StepServer
Tier / qty (GA)Client draft only
Seat selectPOST /v1/seats/hold (when seated)
Add-onsClient draft; preview-total for live price
Coupon codesOptional coupon_codes on preview-total + POST /v1/orders
Review → PlacePOST /v1/orders creates reserved order + payment client secret
PayConfirm 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 attendees on POST /v1/orders and keeps the values for a payment retry.
  • attendee_details_required and attendee_details_invalid from the server land in state.lastError as 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-key on the client.

Host responsibilities

You own:

  1. Loading catalog (event / tiers / add-ons / bundles)
  2. Building the Stripe return URL (buildPaymentReturnUrl)
  3. Post-pay navigation (onPaymentComplete → confirmation / tickets)
  4. Optional: seatCatalog for reserved-seat events
  5. 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.

Next