#Santiago Bouso

1 messages ยท Page 1 of 1 (latest)

pliant parrotBOT
turbid thorn
#

hi, let me think about it

turbid thorn
#

sounds like you want inclusive tax https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior
(above screenshot is for

const session = await stripe.checkout.sessions.create({
  success_url: 'https://example.com/success',
  cancel_url: 'https://example.com/cancel',
  line_items: [
    {price: 'price_xxx', quantity: 3},
  ],
  discounts:[{coupon:"<20-off-coupon>"}],
  mode: 'payment',
  automatic_tax: {
    enabled: true,
  },shipping_address_collection: {
    allowed_countries: ['IE'],
  },
});

)

oak tulip
#

"above screenshot is for..."?

turbid thorn
#

the screenshot is from a CheckoutSession I created using the code I posted

oak tulip
#

Ok!

#

So the taxes are being calculated automatically in this case

#

Based on? Business location?

turbid thorn
oak tulip
#

Wait, now that I'm looking carefully to your screenshot, that's not the expected result, that's actually my exact problem

#

The TOTAL should be 240 PLUS taxes

#

In your example, the total is 195.12 plus 44.88 taxes ===>> 240
What I need is 240 plus 44.88 taxes (or the corresponding value) ===>> 284.88

#

That was my original problem that made me ask here how to avoid that ๐Ÿ˜ฌ

turbid thorn
#

then you want 'exclusive' tax instead I suppose

oak tulip
#

Nice!

#

So, last one, where did you set, in your code, the exclusive tax configuration?

#

Or you set it when creating the prices?

#

On each price?

turbid thorn
#

you set it when creating the Product

#

best to play around with it in test mode and follow the docs etc and let us know if you get stuck anywhere

oak tulip
#

Thank you very much

#

I'll do that ๐Ÿ‘

#

Sorry for coming back, but after reading the docs, I have one last question: aren't we able to set a tax amount in a Checkout Session? I mean, not an auto calculated tax value, but a manually set value?

brazen parrot
#

Hi, I'm taking over my colleague ๐Ÿ‘‹

oak tulip
#

Hi, vanya!

brazen parrot
oak tulip
#

That sounds to be what I need, but for what I see, this Tax Rates are applied to the line items (inside a Checkout Session)

#

What I need is to apply Tax Rates to the whole Checkout Session, not to its line items

#

That was my original question/problem

#

Is that possible?

brazen parrot
#

No, taxes are always calculated per line item.

oak tulip
#

So, in conclusion... if I want to apply taxes to the whole Checkout Session... the only way to calculate those taxes is automatically, using Stripe functionality for that

#

And there is no way to apply something like "Tax Rates" to the Checkout Session total value

#

Is that right?

brazen parrot
#

Yes, that's correct.

Note, Automatic Tax is also calculated for to each line item individually, but you only enable it in one place.

oak tulip
#

Understood!

#

Thank you for your help

brazen parrot
#

Happy to help. Let me know if you have any other questions.