Skip to content

🤖 Prefill public checkout from URL query params (name/email + optional lock)#1234

Open
skvost wants to merge 4 commits into
HiEventsDev:developfrom
skvost:feature/checkout-query-param-prefill
Open

🤖 Prefill public checkout from URL query params (name/email + optional lock)#1234
skvost wants to merge 4 commits into
HiEventsDev:developfrom
skvost:feature/checkout-query-param-prefill

Conversation

@skvost

@skvost skvost commented Jul 1, 2026

Copy link
Copy Markdown

What & why

Integrators that link to or embed the public checkout (a mobile app WebView, a personalized email link) often already know the attendee's name and email, but there's currently no way to pre-fill the checkout "Your Details" form. The fields are controlled Mantine inputs with generated ids, so DOM injection from an embedder is unreliable. This adds opt-in, frontend-only query-param prefill.

Note: issue creation on this repo appears to be restricted for my account, so I'm opening this directly with a full description per CONTRIBUTING. Happy to move the discussion wherever you prefer, and to adjust the param names / behaviour.

Behavior

  • Details step (/checkout/:eventId/:orderShortId/details) reads first_name, last_name, email and prefills the buyer's "Your Details" form (and copies to ticket attendees). email_confirmation is derived from email; a malformed email is ignored. Only the waitlist param was read here before, so there's no collision.
  • lock=true (or 1) makes the prefilled fields read-only — per-field: a field locks only if its param was provided. When locked, the "copy details to attendees" control is hidden so locked values can't be blanked.
  • Propagation: the same params are carried from the event page through order creation to the details step, so /event/:id/:slug?first_name=…&email=…&lock=true works — not just a direct checkout deep-link.

Scope

Frontend-only. No backend, no migrations, no new dependencies, no new translatable strings.

  • New frontend/src/hooks/useCheckoutPrefill.ts — parses/validates the params; exports CHECKOUT_PREFILL_PARAM_KEYS as the single source of truth.
  • CollectInformation — prefill buyer + ticket attendees, per-field lock, hide the copy-control under lock.
  • SelectProducts — forward the prefill params on the checkout navigation.

+ in email must be percent-encoded (%2B), per normal URL query semantics. npx tsc --noEmit introduces no new type errors.

Testing

Manually verified against a local stack (Docker), driving the real event page → select ticket → Continue → details flow, on both a free and a paid event:

Scenario Result
Full prefill + lock=true ✅ all fields filled + locked; copy-control hidden
Full prefill, no lock ✅ filled + editable; copy-control visible
lock=1 ✅ locks
lock=false / other values ✅ does not lock
Email only + lock ✅ email + confirm locked; names editable
Names only (no email) ✅ names filled; email blank
Invalid email ✅ ignored (field blank + editable)
Plus-address, encoded (%2B) ✅ kept
Raw + in email ✅ dropped (decodes to space → invalid)
Whitespace-only name ✅ dropped
lock with no fields ✅ locks nothing
No params ✅ behavior unchanged
Propagation: event → details ✅ params ride through order creation
Multiple attendees (qty 2+) ✅ each attendee prefilled + locked per-field

Screenshots: event page with prefill link, and the resulting locked details page (attached below).

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@skvost

skvost commented Jul 1, 2026

Copy link
Copy Markdown
Author
image

skvost and others added 4 commits July 1, 2026 15:26
Parses first_name/last_name/email/lock from the URL, validates email,
returns a stable { prefill, lock } for the checkout details form. 🤖

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…lock

Merges useCheckoutPrefill values into the details setValues effect (buyer +
ticket attendees, email_confirmation derived from email) and disables prefilled
fields when lock is set. 🤖

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Hide the copy-details control when lock is set (locked attendee inputs are
disabled, so resetting them was unrecoverable and dropped locked data). Also
skip attendee prefill under PER_ORDER collection and document the effect-deps
omission. 🤖

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
SelectProducts forwards first_name/last_name/email/lock from the event page URL
into the order-creation navigation, so query-param prefill survives to the
checkout details step (not just direct deep-links). Adds
CHECKOUT_PREFILL_PARAM_KEYS as the single source of truth. 🤖

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@skvost skvost force-pushed the feature/checkout-query-param-prefill branch from 8c33f4a to 12b21bd Compare July 1, 2026 13:28
@skvost

skvost commented Jul 1, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant