Prefill customer email via Stripe Payment Link URL

Viewed 2343

I'm testing out Stripe's new Payment Links in a project, and I'm trying to prefill a user's email address in the email field of the checkout form. I tried appending the payment link URL with the "email" data attribute, which doesn't work, the data isn't passed on:

https://buy.stripe.com/14k...fYZ?email=johnsmith@gmail.com

I know Stripe's client-side checkout solution does allow for this, but I'm trying to just use the Payment Link, since it's so much simpler. Any help would be greatly appreciated, thanks!

3 Answers

Update: it looks like this is now possible using URL parameters including ?prefilled_email. See documentation

You can't pass query string params to Stripe payment links but there is a workaround using PriceBlocs payment links which are built on top of Stripe Checkout.

You can pass params for the following Stripe Checkout params:

Heres a working demo link with an email param appended. When checkout starts, you'll see the Stripe checkout email field is pre-filled. https://priceblocs.com/test/links/1owa3UYo-2hKvRIXJEu79?email=someone@email.com

And then they'll get forwarded into the Stripe checkout session call. That way you'll get the result you want without having to write any backend code.

Docs for payment links are here.

API docs are here.

And there's a link builder playground here.

Related