#smjarr89
1 messages · Page 1 of 1 (latest)
What are the amount values now? What are you expecting them to be?
I would expect the amount to be 1500 and amount_excluding_tax to be 1373. Instead its being treated as tax exclusive and im getting 1500 + 139(ish) for a total of 1639
Hi, stepping in here.
Can you share the request id where you try to override this tax behavior so I can further review this?
sure - is this what you're looking for? first time using this help discord so apologies in advance. The tax rate that gets passed into the request is set to exclusive.
this.useStripe(async (stripe) =>
stripe.invoiceItems.create({
customer: this._customerId,
amount,
tax_rates: taxRate ? [taxRate] : undefined,
invoice: invoiceId,
description,
currency: "usd",
metadata,
tax_behavior: "inclusive",
}),
);
Sorry I was looking for a request id to see the exact behavior. Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_d3uB3GSlsGP23c
From looking at the code block, it looks like you're passing 'inclusive' on your tax_behavior parameter enum which means that it's included in the price: https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-tax_behavior.
If you're trying to exclude the tax from the price, you'd want to pass 'exclusive'.
Yes - but then my final amount_due on the invoice object its adding tax to that value. Rather than calculating amount_excluding_tax based on my desired total.
I get the desired behavior if my tax_rate is also set to inclusive
this is my finalized invoice request req_5Ucw4Af1a9kX1k
Can I ask why you're passing a tax rate when you intend to have an have the tax be inclusive?
We still want the tax calculated based on the local tax rate (tax rate id we are passing in).
For example here is a request where the tax rate is set to inclusive req_aN5aFjn5t8Srti. This is the desired behavior we want if the rate is exclusive but we pass in a tax_behavior of inclusive as an override. amount_due is 1500. Then on our line item you'll see the amount_excluding_tax is automated calculated at 1373 leaving the tax to be 127.
Thank you for your patience here, still looking
Ok, got to the bottom of this.
When you created the tax rate, you set the inclusive to false, https://dashboard.stripe.com/test/logs/req_JtGYbxTXvyMa7T. Here is API reference: https://stripe.com/docs/api/tax_rates/create#create_tax_rate-inclusive
I tested this on my end and to achieve what you're looking for, you'd need to set that true: inclusive: true and then pass the tax rate, and tax_behavior: 'inclusive' when you create the Invoice Items, https://stripe.com/docs/api/invoiceitems/create.
Here is a screenshot of my test and I think that is what you wanted to achieve.
@gaunt flume let me know if you have any questions on this
So basically the tax rate cannot be set to exclusive and then be overridden on the fly to inclusive when creating the invoice item?
We would need to update the tax rate before?
That is correct! This can't be overridden.
Ok thank you for your help.
I think at that point we wouldn’t even need the tax_behavior property on the create line item call. Does it serve a different purpose that you know of?