#miguel-neto_api
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/1288886861133254727
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- miguel-neto_api, 3 days ago, 7 messages
tax rates is returning an empty array
{
"object": "list",
"data": [
{
"tax_amounts": [
{
"amount": 660,
"inclusive": false,
"tax_rate": "txr_1Q31rmG3S8fFq7IgI8PvCzcu",
"taxability_reason": "taxable_basis_reduced",
"taxable_amount": 8000
}
],
"tax_rates": [],
...
}
],
"has_more": false,
"url": "/v1/invoices/in_1Q31rmG3S8fFq7IgvuECvhL3/lines"
}
It is returning something like this
Yeah that makes sense
That invoice didn't use manual tax rates
So it's expected that array is empty
I know that inside of 660 of tax there are multiple tax rates.
it's using stripe tax
It's using automatic tax
tax_rates array is for manual tax rates
Look at that tax_amounts hash
That's what you likely want
{
"id": "txr_1Q31rmG3S8fFq7IgI8PvCzcu",
"object": "tax_rate",
"active": false,
"country": "US",
"created": 1727296278,
"description": null,
"display_name": "Sales Tax",
"effective_percentage": 8.25,
"inclusive": false,
"jurisdiction": "Texas",
"jurisdiction_level": "multiple",
"livemode": false,
"metadata": {},
"percentage": 8.25,
"state": "TX",
"tax_type": "sales_tax"
}
This is the tax rate object.
Sorry what's your question now?
I know that 660 of tax is actually multiple taxes combined (this is for texas where there's state and local tax).
I want to get that breakdown.
I can see this on https://dashboard.stripe.com/test/tax/registrations/taxreg_1Q31p8G3S8fFq7IgfxrzCTx9. But I want to get it on the API
Hello! I'm taking over and catching up...
Thanks
You can list Tax Registrations using the API: https://docs.stripe.com/api/tax/registrations/all
Will that work for what you're trying to do?
That should be available via that approach.
On each Tax Registration object you get back that detail should be somewhere under country_options. For example, here are the country_options for US Tax Registrations, which seem to have the detail you're asking about: https://docs.stripe.com/api/tax/registrations/object#tax_registration_object-country_options-us
This is what I get for Texas. Do I need to expand some field?
Isn't there a way to see the stripe taxes associated with an invoice?
It shows that's a state sales tax. What additional information do you need?
There are local taxes for Texas.
I would need to know for on invoice how much local and state taxes were calculated by stripe tax
That information should be available on the Invoice itself.
The Tax Registration only represents that your account is registered to collect a particular kind of tax.
Have you looked at the total_tax_amounts property on the Invoice in question? https://docs.stripe.com/api/invoices/object#invoice_object-total_tax_amounts
Yes, it just shows the aggregated value for the tax
Is this the same Invoice that's shown in your screenshot above?
Is it possible to expand the information on the taxes?
I'm not clear on what information you want expanded, exactly. You can expand the Tax Rate: https://docs.stripe.com/api/invoices/object#invoice_object-total_tax_amounts-tax_rate
Yes this is the same invoice
expanding just tax rates wouldn't work for me
It just comes with an aggregated tax amount. I need to know a local break down.
is there a way to access this reporting summary through the api?
Ah, okay, I understand what you're asking for now. You want the report for all the tax collected for a given Tax Registration, not just the tax for a specific Invoice. I believe the detail you want is in the report documented here: https://docs.stripe.com/reports/report-types/tax
You should be able to run and then retrieve that report via the API: https://docs.stripe.com/api/reporting/report_run
You have to wait for the report run to finish, then you can access it via the API. This walks you through the details: https://docs.stripe.com/reports/api#report-runs
It has finished
Okay, cool, there should be a result property which in turn contains a url property which points to the report you can download.
Your secret key, as shown in the example in the docs I linked to above.