#hamidm-tax-error
1 messages · Page 1 of 1 (latest)
Hi there!
Snufkin had to step away. Can you summarize the issue for me here? I'd be happy to help
Hi @analog pulsar , thank you for you help. This was my question:
How can I preview tax amount for a given subscription before incrementing the quantity (purchase new seats logic) with Stripe Api and the next question is how to preview the tax amount before user subscribes (no customer yet), basically on checkout where the customer has selected the price and has the quantity for the subscription also with Stripe Api?
So looks like you are already using the Preview Invoice API based on the request above.
Did that not return the tax amount as you expected?
no it didn't, it returns the tax for the initial price and not for the prorated amount
So you want to specifically see the tax amount based on the proration from an upgrade
Yes, exactly. I need to preview the tax before the customer purchases new seats (increment quantity)
Gotcha
In this case you want to use subscription_proration_date: https://stripe.com/docs/api/invoices/upcoming#upcoming_invoice-subscription_proration_date
(Wrong link, edited)
I'm already using this attribute for calculating the current prorated amount per quantity, and this is how it's done:
$invoice = $company->upcomingInvoice([
'subscription' => $subscription->stripe_id,
'subscription_quantity' => $quantity,
'subscription_proration_date' => $proration_date
]);
But when I get the $invoice->tax it returns the tax amount for the initial invoice instead of the prorated one
or it returns null
Hmmm
Hi 👋
Hi @delicate cedar
So I'm looking at the request parameters you passed in to the Upcoming Invoices API and I'm not seeing a subscription_proration_date being passed
No worries, I'll take a look
Okay so let's check the description of that API parameter:
If previewing an update to a subscription, and doing proration, subscription_proration_date forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period, and cannot be before the subscription was on its current plan. If set, subscription, and one of subscription_items, or subscription_trial_end are required. Also, subscription_proration_behavior cannot be set to ‘none’.
So your date (8/22/2022) falls between the current period start 8/21 and end 9/21 so we are good there.
But the description also states that you must include either subscription_items or subscription_trial_end for this to work.
I don't see either of those in your request
Let me add and test it
Also, subscription_quantity is not a valid parameter
I think you want to look at providing the subscription_items which is where you can update quantities for each item in the subscription.
https://stripe.com/docs/api/invoices/upcoming#upcoming_invoice-subscription_items
tested with subscription_items. This is my request: req_UXOEHOTkjAZSCm
Can you please take a look?
Okay that looks like it should work. Did you see the proration as you expected?
The proration amount yes, but not the tax for that prorated amount
Let's say I have the Monthly price of $5 that I have subscribed 2 days ago and the tax for that was $0.24, so when I want to increment quantity today, the price for one quantity will be $4.92 that I get this amount with the upcoming invoice proration api call, but in that api call I cannot see the tax for that $4.92 amount. I hope you can understand my problem
Yes I can see how that would impact what you can report to your users.
Is there anything that can be done to achieve this?
I'm looking for more information on this
thank you
Can you provide the API response you got back for that latest request?
We are seeing automatic_tax.failed: true in the response
We are currently having an issue with our automatic tax calculation that we are working to resolve
So I think your latest API request is correct but we are not able to calculate tax currently.
Is there something that we can do or should wait for your resolution from your end?
You should await a resolution on our end. Once it's resolved the last API request you made should work as expected. You can monitor our status here: https://status.stripe.com/
Check Stripe system status and see recent API status updates.
hamidm-tax-error