#smjarr89

1 messages · Page 1 of 1 (latest)

haughty dawnBOT
hazy haven
#

What are the amount values now? What are you expecting them to be?

gaunt flume
#

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

dull tapir
#

Hi, stepping in here.

#

Can you share the request id where you try to override this tax behavior so I can further review this?

gaunt flume
#

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",
  }),
);
dull tapir
gaunt flume
#

req_d3uB3GSlsGP23c

dull tapir
#

If you're trying to exclude the tax from the price, you'd want to pass 'exclusive'.

gaunt flume
#

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

dull tapir
#

Can I ask why you're passing a tax rate when you intend to have an have the tax be inclusive?

gaunt flume
#

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.

dull tapir
#

Thank you for your patience here, still looking

dull tapir
#

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

gaunt flume
#

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?

dull tapir
#

That is correct! This can't be overridden.

gaunt flume
#

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?