#WhySoAsync-customer
1 messages · Page 1 of 1 (latest)
To clarify - you're asking how to know which customer is tied to the account they've created on your own site right?
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?
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
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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
Yup, I see no issue with that 👍
Nice !! thank you !