#Oleksiy
1 messages · Page 1 of 1 (latest)
Currently, passing existing customer into pricing table is not supported
I suppose I can not pass customerID in PaymentLinks neither ?
Is there a way to avoid duplicated customer in Stripe?
PS . Saas - recurrent subscription model.
Or can I provide customerId in the checkout page using 'stripe.checkout.sessions.create' in SDK to generate the url?
Payment Links doesn't support passing customer, but Checkout Session supports. For Checkout Sessions, you can set customer parameter in API: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer
This is the integration doc to use Checkout Session to create a subscription: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=checkout
In step 3 - Create a Checkout Session of above doc, you can include customer in the creation to use existing customer: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer
so in the subscription flow it goes like this : CUSTOM pricing table -> on click request to the backend to get URL -> on the backend I do stripe.checkout.sessions.create and return URL ro Frontend -> redirects to that URL with checkout page where all the info is already pre-populated since it is an existing customer and after checkout the Stripe will not create a new customer but use the one I sent ?
Sorry that I misunderstood your question. Previous recommendation only works on standalone Checkout Session without pricing table.
With pricing table, re-using existing customer is not supported. Pricing table will always create a new customer.