#sanderfish
1 messages ยท Page 1 of 1 (latest)
Hi there, the retrieveUpcoming would return an invoice object, and you'll find all invoice properties, including default_tax_rates in that invoice object
I thought that, but the default_tax_rates endpoint comes back as an empty array
{
...
"default_tax_rates": [],
...
"tax": 609,
"total": 3509,
"total_discount_amounts": [],
"total_excluding_tax": 2900,
"total_tax_amounts": [
{
"amount": 609,
"inclusive": false,
"tax_rate": "txr_1Njyy8J7i86GeQKl3UTiQFCT",
"taxability_reason": "standard_rated",
"taxable_amount": 2900
}
],
...
}
can you tell me what you want to achieve here? do you want to set a default_tax_rates when retriving an upcoming invoice?
In our checkout flow, I want to display the tax type (sales tax, vat, gst etc), percentage and resulting tax amount
I'm following https://stripe.com/docs/tax/subscriptions#preview-price to preview the calculation
Yes, but why default_tax_rates? Just so you know, default_tax_rates is for line items that doesn't have tax_rates set (see https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates )
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Sorry if that's confusing, it doesn't have to be from default_tax_rates, but that's what I found in the API docs
I was looking where Stripe returns the tax_type and percentage
for example it is returned in the tax calculation api: https://stripe.com/docs/api/tax/calculations/object#tax_calculation_object-tax_breakdown-tax_rate_details-tax_type
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
but I thought I wouldn't need to use the tax calculation endpoint when using automatic tax on subscriptions
Hmm, I think you want to expand the total_tax_amounts.tax_rate? the information that you want to get can be found in the tax_rate object (txr_1Njyy8J7i86GeQKl3UTiQFCT)