#xqprtzcv

1 messages · Page 1 of 1 (latest)

vapid orbitBOT
deft igloo
#

I guess I want to access the taxcalc object for the subscription

vapid orbitBOT
deft igloo
#

When I do the tax calculation, I get something like this with a breakdown:

clear mango
#

Hi, taking a look here.

deft igloo
#

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

clear mango
deft igloo
#

Looks like if I calculate tax via a zip code rather than an IP address it is correct

clear mango
#

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

deft igloo
#

Yeah, in my case the ip and the zip are the same, but the tax is different

clear mango
deft igloo
#

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?

clear mango
#

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",
},

deft igloo
#

Yes

clear mango
#

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.

deft igloo
#

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

clear mango
#

Great to hear you've got it figured out.

deft igloo
#

Thank you for your help