#vikingviolinist - Checkout Prefill
1 messages · Page 1 of 1 (latest)
Hello. Just to confirm, are you using the Stripe hosted Checkout?
If so, if you update the shipping address directly on the customer: https://stripe.com/docs/api/customers/update#update_customer-shipping, then creating the checkout session with the applicable customer: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer and enabling shipping address collection: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-shipping_address_collection will prefill the shipping address within the checkout page
Awesome thanks. Will the customer still be able to modify the shipping address in the form?
Yes they will
Is there a way to disable at least the email input?
No. You can prefill that as well, but if not provided, checkout will ask for that
I mean pre-fill the email, but don’t let the user change the value of it.
You can prefill it, but the user will be able to change it
Thank you, very helpful 🙏
No problem!
Hi actually I just tested this out. Sorry for some confusion. If prefilled, shipping address can still be edited. If prefilled, customer email cannot be edited: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-customer
If the Customer already has a valid email set, the email will be prefilled and not editable in Checkout. If the Customer does not have a valid email, Checkout will set the email entered during the session on the Customer.