#xqprtzcv
1 messages · Page 1 of 1 (latest)
I guess I want to access the taxcalc object for the subscription
When I do the tax calculation, I get something like this with a breakdown:
Hi, taking a look here.
Can you share the request id for when you see the 8.7%? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
To confirm your question, you're seeing two different tax percentages between the automatic tax and the tax API for the same tax code?
Yes, I believe so, and I am trying to see the tax breakdown for the automatic tax calculation
Let me look for the id
Here is the tax calculation:
req_JAK3pqiuIEqkMh
Here's the subscription:
req_n3OOR19UqJsoFX
I create the subscription like this:
url="/v1/subscriptions"
data={
"customer":cid,
"items[0][price]": priceID,
"metadata[pk]":pk,
"payment_behavior":"default_incomplete",
"payment_settings[payment_method_types][0]":"card",
"expand[0]":"latest_invoice.payment_intent",
"expand[1]":"latest_invoice.total_tax_amounts.tax_rate",
"automatic_tax[enabled]":True
}
And I believe I need to add something like this to expand: line_items.data.tax_breakdown
To look at the tax rate applied, you'd look at https://stripe.com/docs/api/subscriptions/object#subscription_object-items-data-tax_rates-percentage. I'm trying to reproduce this on my end, thank you for your patience.
Looks like if I calculate tax via a zip code rather than an IP address it is correct
Ahh yeah that makes sense. I've been playing with it a few different ways and was unable to replicate it.
The issue is that I'm using a zip code from where my IP address is
Yeah, in my case the ip and the zip are the same, but the tax is different
This seems relevant here: https://stripe.com/docs/tax/calculating#us-sales-tax
I will have a look. So is there any way to get the breakdown of the percentage that I am seeing from the ip address?
I assume you're looking something similar to this for when automatic tax is enabled?
tax_breakdown: [
{
amount: 1120,
jurisdiction: {
country: "US",
display_name: "Arizona",
level: "state",
state: "AZ",
},
Yes
Yeah, tax_breakdown does not exist on the invoice. However, as you noticed you can use the expand function to expand the latest_invoice, https://stripe.com/docs/api/invoices/object#invoice_object-tax and kook at the tax:.
The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice.
OK, finally figured it out! The ip address and zip code are close to this little square mile city that has weird taxes
And it was calculating tax based on that city
Great to hear you've got it figured out.
Thank you for your help