#WhySoAsync-customer

1 messages · Page 1 of 1 (latest)

torn abyss
#

To clarify - you're asking how to know which customer is tied to the account they've created on your own site right?

loud whale
#

Yes, when i create account i create the customer with the email, but the customerId !== userId in stripe. When i get to Subscription page and i get the products from stripe.prices.list, i need to create subscription with that customerId, where can i store that besides cookies?

#

Can i add that customerId in user details in my database? and use it for subcription?

torn abyss
#

Gotcha - so there are a couple of different ways you could do this. You could tie the stripe ID to the customer account in your own databases. Alternatively, you could also use your "list customers" endpoint with email (see https://stripe.com/docs/api/customers/list#list_customers-email) to find the customer you're looking for

loud whale
#

So it's okay if i patch the customerId to the user details in database? and use it for subscription when he clicks /create-subscription?

#

first 200 from creating user in database then on 200 from stripe create customer i patch the customerId there

torn abyss
#

Yup, I see no issue with that 👍

loud whale
#

Nice !! thank you !