How to handle VAT allocation (different rates + shipping fees) in Medusa v2? #13406
Unanswered
la-ruee-vers-le-bois
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Medusa team,
I’m building a B2B SaaS for firewood sellers in France, and I’ve hit a VAT issue in Medusa v2.
👉 Legal background (France):
In France, shipping fees are considered an accessory to the goods.
If an order contains items with different VAT rates (e.g. 10% for firewood, 20% for accessories), shipping fees must be split proportionally across these VAT rates.
Example: if I invoice €45 shipping TTC, I need to split it into 10% VAT and 20% VAT portions depending on the basket composition.
👉 Concrete example:
Product A: Firewood, €343.00 HT, VAT 10% → €34.30 VAT, total €377.30 TTC
Product B: Accessory, €100.00 HT, VAT 20% → €20.00 VAT, total €120.00 TTC
Subtotal HT = €443.00
Shipping = €45.00 TTC (≈ €40.91 HT + €4.09 VAT at 10% / €? HT + €? VAT at 20%)
In this case, I must allocate shipping proportionally:
Ratio of HT values: Firewood = 343 / 443 = 77.4%, Accessory = 100 / 443 = 22.6%
Shipping split:
Firewood share: €40.91 × 77.4% = €31.65 HT @10% → €3.17 VAT
Accessory share: €40.91 × 22.6% = €9.26 HT @20% → €1.85 VAT
Total shipping VAT = €5.02, so shipping TTC = €45.00
👉 My question:
How can I implement this VAT allocation logic in Medusa v2?
Right now, Medusa only lets me set one VAT rate per shipping method.
I’d need a way to either:
Dynamically split shipping into multiple line items with different tax rates, or
Override Medusa’s tax calculation for shipping to distribute VAT proportionally.
Is there a recommended way to do this in Medusa v2?
If not, do you suggest extending the tax service or creating a custom shipping service?
Thanks a lot 🙏
Beta Was this translation helpful? Give feedback.
All reactions