#thomask_best-practices
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/1325890105742987354
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐
Is your question about requiring billing address collection through the Customer Portal?
Yeah I guess you could put it like that
We focus on specific API integration questions on this server so that's how I'm trying to frame the question.
I don't think there is a way to require the collection of the billing address via the customer portal. It is a feature you can set in the features.customer_update.allowed_updates parameter when specifying a Customer Portal configuration
https://docs.stripe.com/api/customer_portal/configurations/create#create_portal_configuration-features-customer_update-allowed_updates
address
Allow updating billing addresses.
You can enable both the collection of a payment method as well as a tax ID and billing address in the same portal configuration.
Yeah okay, but that's a bit of an odd flow. Because then I'd have to separately get a customer to go through a flow to add a payment method and another flow to add a billing address
I also want to use automatic_tax, but It seems that, when I create a subscription without payment method, this won't work as there's no address for the customer yet
Can I enable automatic_tax later, after the customer has provided their address details?
Yes, you can adjust this parameter with an Update request: https://docs.stripe.com/api/subscriptions/update#update_subscription-automatic_tax
However, I want to caution that Stripe Billing is pretty powerful and flexible but that flexibility comes with a cost. It's pretty easy to shoot yourself in the foot.
I strongly recommend writing end-to-end simulations of your subscriptions flows in Test mode to verify the desired behavior.
Yeah I don't really know where to go from here tbh. I'm following the flow here: https://docs.stripe.com/billing/subscriptions/trials#create-free-trials-without-payment. So during the trial, I want to get users to provide a payment method. So we have a box like this in the sidebar. This takes them to the "add payment method" flow. But after they're done, we still won't have a billing address or VAT id, so we can't use automatic tax.
- Is there anything I can do to make users have to enter their payment details during the "add payment method" flow, just like it is possible with a checkout session (using 'billing_address_collection': 'required'). ==> I think you answered this as no
- I guess that means my only option is to collect the details at the application level and send them to Stripe using the API. Does Stripe offer any UI components for this?
- Any other suggestions?
- Have you tested using the Checkout Session in
mode='setup'? That way you can require billing address collection & tax ID collection - Stripe does have the Address Element for use collection customer address information. https://docs.stripe.com/js/element/address_element
Hello, stepping in because my colleague is leaving soon. I agree that those two solutions are probably the best workarounds for now. A variant of #1 that could be helpful is you can create a Checkout Session in subscription mode with 'billing_address_collection': 'required'. That will mean that the subscription won't be created until the user submits that info through the Checkout Session
Hey! Yeah Checkout Session in 'subscription' mode is fun, but we already have an ongoing subscription, because we create that with a trial when the user signs up (https://docs.stripe.com/billing/subscriptions/trials#create-free-trials-without-payment)
I think a checkout session in setup mode with:
{
"tax_id_collection": {
"enabled": true
},
"customer_update": {
"name": "auto",
"address": "auto"
},
"billing_address_collection": "required"
}
Is what I need
Yep, sounds perfect, that definitely makes more sense if you always want to create the subscription on signup