#bijay_jha

1 messages · Page 1 of 1 (latest)

ruby bayBOT
deep night
#

Hi there!

#

How can I help?

crimson forge
#

As you can see above, I am trying to calculate Tax using above api. Here, I have to explicitly mention the tax_behaviour.

#

Can stripe provide tax_behaviour automatically based on currency or country code?

deep night
crimson forge
#

yeah, I have set automatic here

#

but still, the default value is being set for tax_behaviour is exclusive

deep night
#

When using automatic this should happen:

Stripe will use the price currency to define whether the tax should be added on top of the price (excluded) or included in the price. Tax will be excluded in USD and CAD, but included in all other currencies.
Is this not working?

crimson forge
#

Let me give you the context: Usual scenario, when I create a subscription for my products, I can see the tax is being calculated autmatically and shown in invoices. 2nd scenario: I am using Tax calculation api to create tax details as shown above to show the tax details before a customer purchase a subscription( just a preview).

#

For the 2nd scenario, the automatic behaviour is not working

#

I hope I was able to explain you the concern

deep night
#

For the 2nd scenario, the automatic behaviour is not working
Can you clarify what "not working" means? Can you share the request ID (req_xxx)?

crimson forge
#

what I mean with not working is, if I don't pass the tax_behaviour field in this : stripe.tax.calculations.create({
currency: 'eur',
line_items: [
{
amount: amount,
reference: 'L1',
tax_behavior: 'inclusive',
product: stripeProductId,
}
],
customer_details: {
address: {
country: 'DE',
},
address_source: 'billing'
}
}); the api response is always exclusive tax irregardless of which currency I choose

#

sample response: if the tax_behaviour is not passed explicitly : {
taxCalculation: {
id: 'taxcalc_1NhriyF9yHeYvqmolzxZ85Nq',
object: 'tax.calculation',
amount_total: 1470,
currency: 'eur',
customer: null,
customer_details: {
address: [Object],
address_source: 'billing',
ip_address: null,
tax_ids: [],
taxability_override: 'none'
},
expires_at: 1692872532,
livemode: false,
shipping_cost: null,
tax_amount_exclusive: 235,
tax_amount_inclusive: 0,
tax_breakdown: [ [Object] ],
tax_date: 1692699732
}

#

req_Iz1DTKIyZcystN

deep night
#

Thanks for the clear explanation! Looking into this.

crimson forge
#

sure

deep night
#

the setting in the dashboard is for controlling what happens when we do an automatic calculation. if you do the calculation yourself you need to provide the inputs.

crimson forge
#

hmm..Got it.. Thanks Soma. Can you also let me know if Stripe provides any api that will get me the tax details before creating a subscription.. just to show a preview to customers?

deep night
crimson forge
#

can we get Upcoming invoice even without creating subscription?

deep night
#

Yes, the subscription parameter is optional.

crimson forge
#

cool.. Thanks

#

will try that out

deep night
#

Happy to help 🙂