#amilcar - Stripe Setup
1 messages · Page 1 of 1 (latest)
Hi 👋
Are you using Stripe Connect? Why would your customers need a Stripe account?
thank you for your reply Snufkin! yeah i'm using stripe connect! you know, i was reading through the docs and it didnt state that my customers need a stripe account. but after they purchase a suscription i'm receiven back a customer_id. on the docs, within the manage subscriptions tab, on step 4. provision and monitor subscriptions im reading:
case 'checkout.session.completed':
// Payment is successful and the subscription is created.
// You should provision the subscription and save the customer ID to your database.
break;
- Connect does not equal Customers
You will need Customer records as well if you plan on charging these individuals
Which doc are you referring to?
im on step 4 of this flow!
my main concerned is about this customer_id
when the subscription is successful and the webhook gets triggered im receiving that param
but as far as i understand stripe is the one making the request to that endpoint
What about the customer ID?
how can i connect that customer_id with the customer that made the purchase if is stripe the one making the request to my api?
What request are you talking about? Do you have an example subscription ID?
Subscriptions require a Customer to be set when creating them. They are Customer specific
If you are using a Checkout Session to create the Subscription and you are not explicitly creating a Customer, then Stripe will create a generic one to satisfy that requirement
If you specify always then the Checkout Session will create a customer based on the information it collects
the request to my /api/webhooks endpoint. yes i have one: sub_1LLrUOBZpEaYrHNu94rhCvlA
The request to your API webhook endpoint is to notify you of activity on your Stripe account
Also webhook event object IDs will start with evt_
But yes, in this case there is a Customer ID
The customer was created as a result of using a Checkout session to create a subscription. As I said, all subscriptions require a Customer record associated with them
got it snuf! the customer is being created during checkout.session.create but i can explicitly create it before the checkout.session.create and feed those options with the newly created customer?
and save whatever information i need from that customer to my DB?
Actually the Customer is created when your customer completes the payment.
But if you have the data you need to identify customers in your integration and what a Customer record in Stripe that lines up with your DB then you can create the Customer record yourself and pass it to the Checkout session
Or, at the very least, you can simply pass an email.
https://stripe.com/docs/api/checkout/sessions/create?lang=node#create_checkout_session-customer_email
ok awesome! i guess my other question would be! if i dont provide a customer and they complete a payment. stripe creates that customer for me and i get a customer_id, with that customer_id i get to retrieve information from stripe about that customer recurring charges right?
Yup
For example, Customer is a parameter you can use to filter the Subscription List API
but if that exact same customer then make not a subscription purchase, but a one-time purchase and i dont neither provide any customer info to that action stripe recognizes the same customer and i get the same customer_id from that other purchase or is it a different customer_id i get from this other one-time purchase? idk if that makes sense
would you recommend creating a customer on stripe for every customer that signs up on my app? and just make all the request to stripe with that customer_id?
That did not. No.
If you want to have all the purchases of your customers associated together then it would make sense to create a Customer record for each of your users.
aight! i guess that answers my question snuf! thank you for your time