SaaS CMS has officially launched! Learn more now.

How to add tax to a shipping method


Hi guys, 

I have created a shipping method which is standard shipment and has price 350 kr. I would like to add 25% tax to it. 

First, I created a tax category and added a tax in Administration>Tax Configuration.

My problem is when I call GetTaxToal(), it calculates just the total tax of the lineitems. 

I would like to know how to associate a tax with a shipping method?



Edited, Oct 05, 2018 11:44


That does not sound right. When you call GetTaxTotal it calls to IShippingCalculator.GetShippingTax which calculates the shipping taxes of the shipment (which internally call to ITaxCalculator.GetShippingTax). Did you add matching taxes for the shipping address? 

Edited, Oct 05, 2018 13:05

Hi Quan, 

I have the matching tax for the lineitems for the shipping address ( Tax Jurisdiction group Sweden and have "SE" as code) but maybe not in the shipping method. (I tried to upload a screenshot here, but it failed ).

Maybe I haven't set the the shipping tax right in CommerceManager. (a screenshot)

Would you like to tell me how to create a tax to a shipping method in a correct way? 



Oct 05, 2018 13:27

Can't see your second screenshot. 

The shipping method is only used to calculate the shipping cost. The shipping tax is what ITaxCalculator is for. 

Oct 05, 2018 13:30

Here is the second screenshot, the tax that I created on Tax Configureation

Here is the shippmethod method that I created,

The shipping method has Generic Gatway Provide, shall I use Jurisdiction Gateway instead?

Edited, Oct 05, 2018 13:41

That actually does not matter. What really matters is this

So basically your tax jurisdictions must match the address you are shipping to. The country code must be the ISO ALPHA-3 format, in your case, it should have been SWE 

Edited, Oct 05, 2018 13:47

I have a tax jurisdiction so I got the tax 25% for the LineItems. (The tax jurisdiction that I created) ( A purchase order) 

The problem that I want to solve is, the purchase order has 

  • Items 1380 kr
  • Shipping total 350 
  • Taxes Total 345 (which is wrong, it should be (1380+350)*0,25 = 432,5)
Edited, Oct 05, 2018 14:05

You set it wrong, the Country Code must be SWE, not SE. And you don't have to set the County 

Oct 05, 2018 14:12

The taxes of items works with the tax jurisdiction has country code SE. 

So what you mean, in order to make the tax of shipping work, I must have SWE as countryCode?

Oct 05, 2018 14:53

It should match the country code in your shipping address. Unless you are doing differently I guess you use the predefined countries code, which is SWE.

EDIT: OK now I see that you have your country code to be SE, so that is correct. Still you don't need the county information

Make sure you have shipping taxes configured (not just sales tax)


Oct 05, 2018 15:06

I got the tax of shipping now. Thank you so much Quan! :)

Oct 05, 2018 17:05
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.