'Prefill customer email via Stripe Payment Link URL

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/[email protected]

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!



Solution 1:[1]

Stripe Payment Links do not support pre-filling the customer's email.

However, if you're comfortable writing some code, you can use the Stripe API to create a Checkout Session with a pre-filled email. Once you create the session you can send your customer to the url provided in the Checkout Session object.

Solution 2:[2]

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/[email protected]

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.

Solution 3:[3]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Justin Michael
Solution 2 phoenixbox
Solution 3 Aron Korenblit