Reputation: 321
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
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
Reputation: 51
As of 11th July 2023, Stripe does have limited support for URL prefills. To explore all the supported values:
Upvotes: 5
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
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