#Vasil
1 messages · Page 1 of 1 (latest)
👋 Thanks for reaching out
Are you talking about Stripe Checkout Product ? if so, you can set an existing customerId to the checkout session page:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer
I am using embeddable pricing table (https://stripe.com/docs/payments/checkout/pricing-table) and user selects plan to subscribe from that page
even if i pass customer email to pricing table - user fill in name on card (on checkout step) and Stripe decides to create another user.
Taking a look
AFAIK, you can pass customer Id to Stripe pricing table
I'll ask for another opinion in the meanwhile, please give couple of minutes
Hi! I'm taking over this thread.
Sorry for the delay
Sorry but no it's not possible to pass an existing customer ID to the pricing table.
So Stripe will always create a new customer.
This looks strange to me, because I don't think that our app requires any extraordinary logic. Maybe I miss something conceptually?
Ok, what is the standard way to bind users in app with Stripe customer accounts (in case of embeddable pages)?
Let's say the app database stores Stripe customer ID and app can request subscription details from Stripe by this ID.
You could try to map users to their email addresses:
- Pass the email address to the pricing table as mentioned here: https://stripe.com/docs/payments/checkout/pricing-table#customer-email
- Then you can list all customers with a specific email address using this endpoint: https://stripe.com/docs/api/customers/list
But yes I agree this is not ideal.
The other option is to not use the pricing table, and instead build that yourself with Checkout Sessions, because Checkout Session allow you to pass an existing customer ID: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer
ok, but does Stripe create new customer EACH time user pays subscription or there is any conditions when it reuses existing one? maybe some info compares?
Each time someones starts a new subscription with the pricing table, a new customer object is creates yes.
ok, thank you for clarification. Seems like embeddable pages is not my option
This is a brand new feature, so it has some limitations. So in your case I would recommend using Checkout Sessions directly.
ok, got it, thank you
let me ask quick question: what API should I use to retrieve such information from Stripe (current subscription details)? (this screen is what embeddable customer portal shows, but now I need to implement it)
Subscription information: https://stripe.com/docs/api/subscriptions/retrieve
Payment method information: https://stripe.com/docs/api/payment_methods/retrieve
Invoice information: https://stripe.com/docs/api/invoices/list
But why aren't you using the customer portal directly?
I am looking to it as a reference to understand what info I can retrieve thru API
Do you mean I can just use customer portal for upgrade/downgrade subscriptions?
Do you mean I can just use customer portal for upgrade/downgrade subscriptions?
Exactly, that's why we created this feature.