#jairo094215_invoice-tax-percent-field

1 messages ยท Page 1 of 1 (latest)

stone mortarBOT
raw brookBOT
#

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.

stone mortarBOT
#

๐Ÿ‘‹ 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. Thank you for your patience!

โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime! If this thread is closed and you have another question you'll need to start a new thread.

๐Ÿ”— 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/1214555805483802664

๐Ÿ“ Have more to share? You can add more detail below, including code, screenshots, videos, etc.

raw brookBOT
north wing
#

Hello again ๐Ÿ™‚

#

I've here in relation to my last question

proper pond
#

Hi, let me help you with this.

#

I believe tax is calculated per each item, you can see it in lines.data.tax_amounts/tax_rates.

north wing
#

Since we've started using Stripe Checkout to create our subscriptions the 'invoice.created' Webhook events that we are receiving have the 'tax_percent' value as null

tall nebula
#

It's a deprecated field which is unused if you're using Tax Rates, like you are

#

You'll need to look at the field above if you want the specific % applied by the txr_xxx object

north wing
#

But it's weird, because it is happening since we've started using Stripe Checkout

tall nebula
#

Yep, because Checkout is a new(er) payment UI that uses the Tax Rate objects I described

north wing
#

Before that, all our invoice.created events have the correct tax_percent value. Is it normal?

tall nebula
#

tax_percent is an old field/parameter you can set specifically, but it's deprecated and Checkout doesn't support it

tall nebula
north wing
#

Before that, we used the subscriptions API directly, and we indicated the tax rate using the default_tax_rates parameter on subscriptions creation

#

And by this way we can read the tax_percent of the invoice correctly from this event payload

tall nebula
#

Hard to say without a specific example. But as I said, that field is deprecated entirely so Checkout, a new(ish) API/UI, does not support setting it

north wing
#

But now all invoices of our customers are registering in our system with 0 tax, because we are getting the tax value of the invoices from this property

tall nebula
#

So you'll need to account for that and adjust your webhook code

north wing
#

Ok, then, how can we get the 'main' tax value for the entire invoice?

tall nebula
#

Depends what you mean by 'tax value'?

#

The amount of tax paid, or the tax percentage applied?

north wing
#

the percentage applied

#

For example, if the subscription is created with 21% tax as default tax value, We would like to get this tax percent from the Invoice payload

tall nebula
#

As some items may be tax exempt, which is why a top-level field makes less sense

north wing
#

And if items has different taxes, what value could we interpret as the total tax on an invoice?

tall nebula
#

If you mean %, then you'd have to compute that yourself

stone mortarBOT
#

jairo094215_invoice-tax-percent-field

north wing
#

Sorry, but I don't finish to understand that. What would be the equivalent of what we did before? Before we only read the tax_percent of the invoice, now what should we read to obtain the value equivalent to the old tax_percent?

#

For example, if we have an Invoice with 2 items and both with 21% tax it is simple because we can treat the % of the first item as the main tax of the invoice

#

But what happens if the taxes are different?

tall nebula
#

There is no equivalent field like that today. The easiest way would be to calculate the tax amount as a % of subtotal_excluding_tax

north wing
#

Ok, thanks for the clarification

#

And thank you very much for your support

#

We'll try it

#

A greeting!