#gesundheit-tax-subs
1 messages · Page 1 of 1 (latest)
hello!
Basically I asked the same question last night but there was little help during that time period, let me grab the previous conversation
so, the scenario is:
- the prices of our products are before-taxes
- a new customer, with no payment method attached, decides to buy a subscription of that product
- then, they will see on the side of their screen the "invoice" they will be paying; on the other side, we prompt them to enter their billing information (guaranteed to be card)
what we want after this is that the user sees their invoice being updated with taxes based on their entered billing address
on the backend, when they initially press on checkout, we generate an invoice through the API endpoint subscriptionService.CreateAsync (using Stripe.NET)then we return the client_secret to the frontend and let stripe elements take care of rendering the invoice.
so yeah. basically we wanted the invoice to be updated as the new user enters their credit card info.
hello?
stretched across multiple threads! getting to yours in a sec
ok so before you create the Subscription, you want to show your customer their estimated total with tax, right?
yep
sorry, i was taken away as well
but here's the problem: we wanted to collect taxes based on our customer's billing address. That means technically everywhere Stripe supports.
yeah so what you can do for that is try using the UpcomingInvoice endpoint to "preview" what creating a subscription for that customer would look like and preview taxes on that
hmm, does this affect the flow as mentioned above?
this
and if an upcomingInvoice's automatic_tax is set, where will it get the billing address?
it should get billing address on the PaymentMethod attached to the Customer, that you pass as default_payment_method on the upcoming invoice
hmm, does this affect the flow as mentioned above?
does not affect that, you preview an upcomingInvoice to show what the customer is signing up for, before actually creating it
I'm reading the API on using UpcomingInvoice. It accepts either a customer or a subscription or subscription_items as parameters. What should I pass in when the subscription itself isn't created yet?
also, the flow only attaches the payment method to the customer when they pay the invoice, so the customer will not have any payment method attached before they pay
If the subscription hasn't been created yet you should be passing in subscription_items along with customer
i thought subscription items are only created when a subscription is created
Typically yes, but if you're specifically trying to preview the invoice for a subscription that hasn't been created yet we let you simulate it's creation with the upcoming invoices endpoint by passing in the fields you would set when you create a subscription (example: subscription_trial_end, subscription_cancel_at, etc).
so, i should specify
subscription_items(since i don't have theidfor them because they don't exist, i guess i should supplyprice_ids instead?)- the start and end date of the intended subscription
customer_id
also this. I was trying to creating a subscription with automatic_tax.enabled=true, with a customer that has no payment method. That led to a Stripe Exception since stripe doesn't know where to determine the tax region.
Yes, you'd specify the customer and subscription_items. You'd only need to specify subscription_start_date if you want to simulate it being created not at the time request is being made, and end date (cancellation) is also optional (you only need to set it if you need it)
If they don't have a payment method then this doesn't really work with automatic tax
so i guess we will have to collect the payment method first?
Yeah, if your goal is specifically to test automatic tax with upcoming invoice, I think your only choice would be to collect the payment method first
we'll have to think about this for a bit
I'm going to jump out of this thread for now, since i have another question to ask
completely unrelated to this
You can still ask it here!
mm oko
ok
so we are thinking about preview invoices (well yeah upcoming invoices)
long before the renew period
When you say "long before the renew period" do you mean a different billing cycle, or is it the same billing cycle but the renewal date is just a ways off?
same billing cycle, same renewal date
but being able to have the invoice generated so that the user has a pdf to look at
If you want to generate an invoice for the user to look at that would be something you need to make yourself, but upcoming invoice should still work perfectly fine with this
ok, got it. it's just a matter of how we generate the pdf using the info returned through upcoming invoice
Yup! and that part would be up to you to implement
cool, thanks!