#voskobovich-subscriptions
1 messages ยท Page 1 of 1 (latest)
hi! that's a common constraint, there's nothing specifically in Stripe that enforces that automatically but it's something you could build out.
Generally the main approach is that you authenticate the customer and map them to a Stripe Customer object cus_xxx (create one if they are a new customer/look up the ID from your database for returning ones). Then you can store in your database a flag that they already had a trial, or use https://stripe.com/docs/api/subscriptions/list#list_subscriptions-customer to look for existing trial subscriptions that might have had; and then prevent them from signing up for more
@fallen sparrow thanks for your answer ๐
Did I understand correctly? Stripe does not provide built-in tools to implement this constraint. I have to store information of the use trial by the customer on the server-side and decide need to activate the trial or not for each purchase.
indeed yes
@fallen sparrow Okey... ๐ฆ Then there are some more questions.
How can I prevent duplicate customers in the Stripe dashboard? My server-side get a new customer with the same email each time after checkout.
This answer says https://stackoverflow.com/questions/26392819/stripe-making-multiple-customers-with-same-email-address that I can't prevent it.
how do you integrate, do you use our Checkout hosted payment page, or something else?
well that is from 8 years ago
I use Stripe checkout link.
then the best way to avoid it is to authenticate the customer in your own system before redirecting them, and then if you already have a Stripe Customer for that user, pass it to https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer so it processes the payment with that Customer instead of creating a new one
a really simple implementation might be to ask them for their email address first and then use https://stripe.com/docs/api/customers/list#list_customers-email , but otherwise you would check your own database etc
My system is very simple and doesn't have a customer identity system by email right now.
I am selling license keys for software. In my database, I store only the relationship between the transaction ID and the license key. After checkout, I use the email from the Checkout Webhook event to send an email with the license key for my customer.
The best way for me is if Stripe can store only unique customers by email. But as I understand it, Stripe does not have such built-in capabilities, right?
Hi there ๐ Jumping in as my teammate needed to step away. Correct, there is no prebuilt customer duplication prevention.
Hi @atomic beacon! I understand you. Thanks ๐
Any time!
@atomic beacon Can I create a one-time coupon for a customer's email? For example: I give the same coupon to all my customers, but each of them can only apply it once.
As I understand it, if a client is created every time a new one is, then it is impossible to implement such a restriction using Stripe's tools. Right?
Not without adding additional logic to handle that on your end. You're correct, we have a setting that allows a coupon to only be used on initial purchases, but if each checkout is a new customer then that limitation won't work for your scenario.