#IGBenetts-pre-fill
1 messages · Page 1 of 1 (latest)
If you pass in the customer's ID in to the customer parameter, that will prefill info for you https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yep yep
When the Checkout Session first completes?
That will be customer directly on the Checkout Session. I think the PI will have it too, let me check
Yes it will
If you are retrieving it like that, yes
I was wrong, it was the CheckOutSession
My bad
Another question, Can I send the customer_id on the success_url? Or I can only send the CheckOutSession?
Yes, you can set it on the success_url if you want. success_url will take whatever valid URL string you give it
If you already have a customer object yes
You can add the customer ID cus_123 yourself
Unfortunately this is not like the {CHECKOUT_SESSION_ID} parameter where Stripe fills it out automatically
Oh okay
Again in this case. Where do I put the customer_id?
Next to 'mode' => 'payment',?
Yes, the customer parameter is at the same level as the mode parameter
And to be clear, the first time you create the session, you will not have a customer object to put in that param. Once the session completes, you can store that customer ID and if you know that customer is back, that is when you can provide it.
Okay! Thank you so much!
Of course, happy to help