#javier_checkout-optional-phone-number
1 messages · Page 1 of 1 (latest)
👋 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/1364988577775091857
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
I'm using Stripe Checkout (hosted page) via the Stripe Node.js SDK in a Next.js 15 API route.
I create the session with stripe.checkout.sessions.create(...) from my own backend, and I pass in customer data, shipping address collection, and allowed countries.
I'm not using Elements or the client-side SDK — just redirecting the user to the hosted Checkout page and handling the result with webhooks.
Gotcha then phone number shouldn't be collected by default. Are you forcing it via the phone_number_collection param?
Or are you talking about the Link phone number collection.
Which is a bit different
I am passing phone_number_collection: { enabled: true }, because I wanted to display the phone field — but ideally, not require it.
From my tests, when that option is enabled, the phone field is always required.
Ah yeah no you can't display it and not have it required.
Hmm however
As a workaround
I believe you could use a custom field
Yeah that should work
Like so, right?
custom_fields: [ { key: 'phone', label: { type: 'custom', custom: 'Phone Number (optional)', }, type: 'text', optional: true, }, ],
I think you want type: 'number'
But otherwise yeah that looks good to me.
Next step would be to test it out
Thanks a mill @little onyx we’d lose the phone number validation that comes with phone_number_collection, but it's all good