Online travel companies like Expedia Inc. and Orbitz LLC have been facing a proliferation of lawsuits filed by counties and cities that allege the companies aren’t paying their fair share of hotel occupancy taxes that they collect from customers. The lawsuits are based on ordinances that vary from jurisdiction to jurisdiction. But many allege that the companies should pay tax based on the markup price they charge customers, not on the wholesale price they paid when they purchased the rooms. The differences can add up to millions of dollars.

So, how do online booking companies combat these suits?

Richard Nielsen, a federal tax controversy senior counsel in Pillsbury’s San Francisco office, said that one way companies can do so is by simply conducting an examination into whether the other side has followed the rules in filing such cases. For instance, he said, several cases have been thrown out because the municipalities bringing the suits failed to exhaust their administrative remedies.

Defendants should also be aware of any sensitivities in the courts hearing their matters. “Some courts are concerned about the public [treasury], and so they rule in favor of the municipalities,” Nielsen said. “But other courts say that the taxes are limited to whoever physically operates the hotel and they keep it really narrow.”