When Texas state Rep. John Otto found out that Amazon was challenging a $269 million bill for uncollected state sales taxes, he was surprised. Several states have been trying to force the Internet retailer to collect the tax on sales to its in-state customers, but Amazon’s physical presence -- or nexus -- in those states has been disputable. In Texas, it is clear. Amazon has a large facility in Irving that it uses to distribute the books, electronic devices and other items it sells from its website.

What Otto couldn’t figure out was how that facility did not fall under the “nexus standard” that a 1992 Supreme Court case, Quill Corp. v. North Dakota, set for requiring a remote seller -- such as an Internet or catalog company -- to collect sales taxes.

So Otto dialed up the state comptroller. He asked her what tools she needed to collect the $269 million that had been accruing for four years. “I told her, ‘To the average citizen, this company has physical presence here.’” What the comptroller told him was that Amazon claimed it was not in Texas as a retailer, that the Irving facility was a “distribution center.” Moreover, it claimed that its plant was a subsidiary -- and thus, a separate entity.

As Otto saw it, the Quill decision doesn’t draw such distinctions. It speaks only to physical presence. So he introduced legislation that insisted that Amazon had an obligation to collect and remit the taxes. “If you have a subsidiary, control 50 percent or more of it and it has physical presence in the state,” Otto says, “then you should collect our sales tax.” Although it led to a showdown with the governor, Otto considered his bill a very conservative approach. “I wasn’t trying to push the envelope,” he says.

But other states have been. And for good reason. Uncollected Internet sales taxes -- whether they’re from sales on Amazon.com, Overstock.com or any number of other Internet-only retailers -- are a big deal. A study published by the University of Tennessee estimates sales tax losses on e-commerce will be $11.4 billion next year. The total estimated loss between 2007 and 2012: $52 billion.

The impetus to collect that money is fed in part by the revenue losses states have experienced during the Great Recession and which continue today. But there is also a frustration that this is money that is due the states. It’s not a new tax after all, states argue. If the retailer does not collect the tax, consumers are supposed to report their purchases on their state tax returns and pay the tax themselves. They rarely do, however, because most don’t know they are required to do so or how to do it.

States have been coming up with a variety of ploys -- some conservative, others more radical -- to get Internet retailers to collect the tax. Their efforts range from a handful of states claiming nexus via in-state affiliates that sell on the big-name websites to a 24-state compact to streamline sales tax systems. At the same time, states that levy sales taxes have come up with new allies in the fight to get the U.S. Congress to redress the collection issue and undo Quill. These allies include not just small mom-and-pop stores on Main Street but also giant retailers such as Target and Wal-Mart -- retailers with robust Internet sites that do collect the sales tax because they have nexus in almost all states.

At every turn, Amazon has gone to great lengths to block state collection efforts. In states that claimed nexus because Amazon affiliates were located there, Amazon ended relationships with those businesses and, in turn, pursued litigation in the state. In states where it had facilities, it threatened to pull them out, thereby raising the specter of eliminating jobs. And where Amazon wanted to open facilities, it insisted on a free pass on tax collection. Amazon declined interview requests for this story.

Its pugnacious ways have paid off in some states, where the company was given the green light not to collect sales taxes for years -- so long as it kept or built a facility in the state. But those ways have left bruised feelings, especially among legislators. In Tennessee, where legislators have been rethinking a deal Amazon struck last year to build distribution warehouses in return for not collecting the tax on goods shipped from those facilities, state Sen. Randy McNally likens Amazon lobbyists to take-your-lunch-money bullies. “They are making demands on the states that if a smaller business came in and tried to do, we’d laugh at ’em.”

This fall, however, there was what may be the biggest breakthrough on the Amazon tax front: California’s settlement with the company. After fighting legislation that would require out-of-state online retailers to collect sales taxes if they had affiliates, offices, workers or other ties to the state, the company ponied up millions of dollars to put the issue to taxpayers via a ballot referendum. It also cleansed its website of California-based affiliates. Then, the company suddenly backed down -- in part because the damage to its reputation was growing. The online retailer struck a deal with the state that will require it to begin collecting sales taxes in California after a one-year grace period. In September, Gov. Jerry Brown signed the agreement into law.

The California deal suggests that Amazon may be changing its game plan. If that’s so, it would probably bring the rest of the Internet retailers into the fold as well. (Amazon recently made a similar deal with Tennessee.) Meanwhile, the states battle on, with legislators contending with the lobbying power of a giant -- juggling the need for revenue versus promises to bring a few jobs to the state.

In Texas, Otto ended up with his hands full. His bill was not well received by Amazon, which tried to persuade him to drop it. “They held out enticement of jobs and everything else,” he recalls. “They started at 3,000 jobs. By the time we were done, they were up to 6,000.” Otto estimates the distribution center in Irving employs about 200 people. He is scratching his head over the number of distribution centers that Amazon would have to build to employ an additional 5,800 people.

But the jobs offer wasn’t enough to turn him around. “I like a level playing field,” he says. “We have companies in Texas who already collect taxes on Internet sales -- like Target, Wal-Mart, and Bed, Bath and Beyond -- because they are physically here. How do you allow a company like Amazon that puts a distribution center in your state to argue they are not physically present?”

Ultimately, Amazon threatened to close the distribution center and pull out of the Lone Star State. That threat got Gov. Rick Perry’s attention. He told Otto he would veto the measure if it passed. It did, with overwhelming approval, and the governor vetoed it on the last day of the session in May. When lawmakers returned for a special session, they struck back. Perry had no alternative but to allow it to become law, even though he saw the law, his deputy press secretary says, as containing “risks of significant unintended consequences, including a loss of Texas job opportunities and weakening of our state’s competitive advantage.”

A similar battle played out differently in South Carolina. Outgoing Gov. Mark Sanford struck a deal with Amazon last year that offered incentives for the company to build a facility in the state and create some 1,200 jobs. The deal included property tax reductions, job tax credits and a five-year exemption from collecting the sales tax. That exemption was not, however, binding on the Legislature.

When Nikki Haley became governor, she complained that the deal was “bad policy” and gave Amazon an unfair advantage over its competitors. However, Haley added that if the Legislature voted to allow the exemption, she would let it become law as she felt bound to honor the deal between Sanford and Amazon.

Initially, the state House rejected the exemption. Amazon reacted swiftly, threatening to cancel $52 million in procurement contracts and eliminate job postings from its website. It also offered some carrots, boosting its offer with a promise to create 2,000 jobs and to increase its investment in a million-square-foot building by $35 million.

Some legislators saw the issue purely as one about jobs since the state struggled with one of the highest unemployment rates in the country. “We had the votes to pass it even though the governor was vehemently opposed to it,” says state Sen. John M. “Jake” Knotts Jr., who backed the bill. “And then the big boys came in, like Wal-Mart, and said the bill to give a sales tax exemption was against small businesses, and they felt it was wrong.” The South Carolina Commerce Department estimated the exemption would create a net gain of $232 million in the first year and $1.7 billion over 10 years.

South Carolina state Sen. Larry Grooms filibustered against the sales tax exemption because he opposed the government picking out one particular retailer for a special benefit. Grooms, a Republican, suggested that the state should either refuse to extend the special sales tax exemption to Amazon or extend it to every online retailer that has a presence in South Carolina. “Amazon wasn’t interested in the sales tax exemption being expanded to all online retailers -- just themselves,” Grooms says.

As the fight over the exemption dragged on, Amazon’s supporters upped the ante. They suggested that the firm would move to Georgia and still make sales in South Carolina without collecting the tax. To which Grooms replies, “I don’t know how folks in Georgia could look their existing online retailers in the eye and say, ‘Yeah, but these guys are special and y’all are not.’”

Though Grooms’ filibuster failed, several ameliorating amendments passed, including one to require Amazon to send a statement to its customers, reminding them to remit the sales tax on goods they purchase on its website and providing a link to the state revenue department.

In the end, Amazon was a big winner. It gained a five-year exemption from collecting sales taxes in return for following through on its jobs and investment pledges.

In California, the fight started out being even bloodier. After the law to force certain online retailers to collect the sales tax was enacted, Amazon spent $5 million to collect signatures for a referendum to overturn it. As in South Carolina, Amazon also dangled the possibility of opening a half-dozen distribution centers and creating 7,000 jobs -- if its sales tax exemption was preserved until 2014.

California state Assembly Majority Leader Charles Calderon worried that the referendum Amazon was collecting signatures for “would be a difficult political fight” for the bill’s backers. Still, lawmakers stood firm. California has been losing $1.2 billion a year in sales and use tax collections from e-commerce, Calderon says, and Amazon does about $4 billion of business in the state. Amazon also threatened to litigate the state’s claims about what constitutes nexus. “We had a pretty good chance in court, but of course nothing is certain when you go to court,” Calderon says. “So the stage was set for some kind of compromise that placed the decision in our hands -- Amazon and the state -- not in the hands of the electorate or the courts.”

Meanwhile, Bill Dombrowski, president of the California Retailers Association, lobbied hard against Amazon interests. The brick-and-mortar retailers found it maddening, he says, that people come into electronics stores, check out expensive flat-panel TVs and then buy from an online retailer. “You can save a couple of hundred bucks if you are not paying sales tax on a TV like that. It is a huge issue and it had to be addressed.”

Amazon offered to collect the sales tax after two years. Calderon called that proposal a “nonstarter.” Ultimately, both sides agreed to a one-year moratorium in tax collections after which Amazon would collect the taxes -- unless federal legislation is enacted. If Congress does not enact legislation, the company would have to start collecting California taxes next September.

Even as it fights the states over the issue, Amazon is supporting a national solution. Legislation introduced in July in Congress, the Main Street Fairness Act, is the latest effort to begin a much-needed simplification of tax laws, but it has not won Republican support this year as it has in the past.

Scott Peterson, executive director of the Streamlined Sales Tax Governing Board, which seeks a settlement on a national basis, is upbeat about the measure’s prospects. The legislation would give the 24 states that have signed on to the streamlined sales tax agreement the authority to require retailers to collect sales tax while also simplifying tax collection for the sellers.

Noting that Senate Majority Whip Richard Durbin, a Democrat, is a sponsor of the bill, Peterson says, “We are extremely optimistic, and all the negative things being said are proof that we are close to actually getting something done.”

But a Senate Democratic staffer said that with no Republican support, “it’s not likely to move.” Given the fierce partisanship on Capitol Hill, a safe prediction is that this measure is a long shot for passage this year -- or in 2012, an election year.

Instead, look for battles to continue to be waged from state to state. Take New York, which is litigating whether the nexus requirement is met when an affiliate business in the state has a link on Amazon (or other out-of-state retailer) and receives a commission on sales after a consumer clicks on the link. New York says that affiliate relationships create a “presence” so that Amazon must collect sales tax. The state won in lower court, but Amazon is appealing -- and collecting the sales tax as the litigation proceeds. As it pursues its case in New York, Amazon has terminated affiliate programs in such states as Illinois, North Carolina and Rhode Island.

In surveying the states’ varied actions, Michael Mazerov, a senior fellow with the Center on Budget and Policy Priorities, applauds Texas and California for standing firm. “If states want to solve this problem, they have to hang together and not be picked off,” he says. “I understand that state officials want to do what they can to create jobs, but the situation in California seems to indicate that when push comes to shove, [Internet retailers will] go ahead” and do business in the state anyway.

For now, Mazerov, who started working on this issue in 1990 at the Multistate Tax Commission, says he is “very supportive of these state-specific approaches, but they can only chip away at the problem; they can’t solve it comprehensively. Federal legislation is the only way to do that.”

When does he see an end to this protracted battle? “Here we are in 2011, and we are still fighting,” he says. “I don’t expect to see this resolved anytime soon.”