#ricky-u_api

1 messages ¡ Page 1 of 1 (latest)

modest foxBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1414942949804085269

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

uncut lagoon
#

hi there!

#

I'm not sure I understand. The request you shared that creates a Customer was made by your own code.

livid oriole
#

Hi Soma, struggling with this one, asked chat too, but couldn't quite find a sol

#

Yes, but i didnt call stripe.customer.create, i called checkout.sessions.create which is only to mount the embedded checkot form to take a payment, but this creates a customer as well.

uncut lagoon
#

but i didnt call stripe.customer.create
at least for the request you shared, your code called stripe.customer.create.

#

can you share a Customer ID (cus_xxx) that you didn't create?

livid oriole
#

hmm, sure. i mean to say i didn't create them directly, but for some reason i assume that when embedded checkout is mounted, it does create the cutomer (even before the form is submmited) - is this correct?

#

i checked again, i am not calling customer.create

uncut lagoon
#

can you share a Customer ID (cus_xxx) that you didn't create?

livid oriole
#

cus_T1S594DbJqCTvq

#

it 2ms prior to checkout sessions, which i assume is called by stripe before checkout session - just a theory, the AI chatbot in Stripe mentioned that when creating a cehckout session (in order to mount the embedded checkout) will also create a customer .. hoping to find a way to do that without.

uncut lagoon
livid oriole
#

would you mind if i paste parts of my code here, just to be sure that stripe.customer.create isn't called, but rather checkout.sessions.create

#

Or let me ask it another way, when I callicalling checkout.sessions.create the result is a client secret, which is then used to mont the embedded cehckout.. Does this checkout.sessions.create , create a customer if none exisits for that email.

uncut lagoon
#

would you mind if i paste parts of my code here, just to be sure that stripe.customer.create isn't called, but rather checkout.sessions.create
I don't think that would help, since your code to create a customer might not be included in the code you share with me.

#

Does this checkout.sessions.create , create a customer if none exisits for that email.
Checkout Session can create Customers yes. but that's not what happened in your code. your code called the customer.create() function to create a customer

livid oriole
#

Got it, i mean i am checking and dont have it logged anywhere. However since you did mention that checkout session themselves can create customers - wouldn't that explain why the logs show that too. -- anyhow to move things along, What I do want to acheive is

  1. Using embedded checkout which i am already
  2. create a customer and a subscription at once (even when passing in a customer_email
  3. I read the docs here https://docs.stripe.com/api/checkout/sessions/object#checkout_session_object-customer and it does say although not clear enough for me to understand that -- "Checkout will create a new customer object based on information provided during the payment flow unless an existing customer was provided when the Session was created." -- the result is i have a lot of ghost customers, users without a payment method (this happens when they leave the checkout process.
#

ill be back in a little to check on this, hopefully i can find a solution.

uncut lagoon
#

either you create your own customer object upfront, and then pass it when creating the Checkout Session on the backend. or don't pass a customer at all, and Checkout Session will automatically create one for you with mode: subscription