Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does "Calculate taxes automatically" work in Medusa v1? #10879

Closed
1 of 2 tasks
u11d-michal-miler opened this issue Jan 8, 2025 · 6 comments
Closed
1 of 2 tasks

How does "Calculate taxes automatically" work in Medusa v1? #10879

u11d-michal-miler opened this issue Jan 8, 2025 · 6 comments

Comments

@u11d-michal-miler
Copy link

What Medusa version and documentation are you using?

v1

Preliminary Checks

Issue Summary

Could someone clarify what disabling the "Calculate taxes automatically?" option in Medusa Admin V1 actually does?

The admin panel provides the following explanation:

When checked Medusa will automatically apply tax calculations to Carts in this Region. When unchecked you will have to manually compute taxes at checkout. Manual taxes are recommended if using a 3rd party tax provider to avoid performing too many requests

We use a 3rd party tax provider and want to optimize API calls. However, even with the checkbox disabled, AbstractTaxService.getTaxLines method is still invoked numerous times.

I expected that disabling the checkbox would stop automatic tax calculations and require us to trigger them manually. However, it seems the calculations are still performed as before. Is it possible to explain how this flag works and provide guidance on minimizing the number of calls to the 3rd party tax provider? I feel the current documentation is not meaningful enough.

Thank you for your help!

Manual taxes doc: https://docs.medusajs.com/v1/modules/taxes/storefront/manual-calculation

How can this issue be resolved?

No response

Are you interested in working on this issue?

  • I would like to fix this issue
@adrien2p
Copy link
Member

adrien2p commented Jan 9, 2025

hi @u11d-michal-miler, thank you for reaching out about this subject, indeed, when the automatic taxes are disabled, it is supposed to prevent the the taxes to be computed every time we get the totals unless force_taxes is being provided. Could you confirm that you are not providing the force_taxes: true options on your call please.

@u11d-michal-miler
Copy link
Author

Hello @adrien2p,
Thank you for your response.
I can confirm that force_taxes is not directly referenced or utilized. However, I found something interesting: when I execute GET /store/carts/${cartId}/, taxes are indeed not being calculated. However, when POST /store/carts/${cartId}/payment-sessions is called, the taxes are calculated. Is this the expected behavior?

@adrien2p
Copy link
Member

Indeed, when calling this end point, the taxes are forced, if you look at the method being called by this end point here

@u11d-michal-miler
Copy link
Author

OK. In that case we need to carefully go through the checkout flow and identify places where taxes fetching is forced by Medusa code. Thank you for your help, @adrien2p!

@adrien2p
Copy link
Member

It is a pleasure, should I close this ticket for now then?

@u11d-michal-miler
Copy link
Author

Sure, I believe the ticket can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants