ArushaofDenmark
ArushaofDenmark

Reputation: 321

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!

Upvotes: 32

Views: 19932

Answers (4)

Aron Korenblit
Aron Korenblit

Reputation: 511

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

?prefilled_email Seems to be working as expected

stripe.com/docs/payment-links/customer-info

Upvotes: 51

chunli
chunli

Reputation: 51

As of 11th July 2023, Stripe does have limited support for URL prefills. To explore all the supported values:

Upvotes: 5

phoenixbox
phoenixbox

Reputation: 101

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.

Upvotes: 3

Justin Michael
Justin Michael

Reputation: 6475

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.

Upvotes: 6

Related Questions