State governments may require online retailers to collect sales taxes even in states where the retailers have no physical presence, the US Supreme Court ruled in a decision issued today.

The 5-4 ruling could clear the way for more states to require collection of sales taxes on products ordered online from out-of-state retailers.

The case, South Dakota v. Wayfair, Inc., Et Al., involved a South Dakota state law "requiring out-of-state sellers to collect and remit sales tax 'as if the seller had a physical presence in the State,'" the decision noted. Online retailers argued that the law was unconstitutional, and the State Supreme Court agreed, but the US Supreme Court overturned the state court ruling. South Dakota expects to collect another $48 million to $58 million in taxes a year because of this ruling.

The South Dakota Supreme Court based its ruling on a 1992 US Supreme Court case, Quill Corp. v. North Dakota, which held that out-of-state companies don't have to collect state sales taxes in states where they don't have a physical presence.

Today's Supreme Court ruling said the Quill decision was flawed:

Quill imposes the sort of arbitrary, formalistic distinction that the Court's modern Commerce Clause precedents disavow in favor of "a sensitive, case-by-case analysis of purposes and effects." It treats economically identical actors differently for arbitrary reasons. For example, a business that maintains a few items of inventory in a small warehouse in a State is required to collect and remit a tax on all of its sales in the State, while a seller with a pervasive Internet presence cannot be subject to the same tax for the sales of the same items.

"Forty-one States, two Territories, and the District of Columbia have asked the Court to reject Quill's test," today's ruling, written by Justice Anthony Kennedy, also said. "Helping respondents' customers evade a lawful tax unfairly shifts an increased share of the taxes to those consumers who buy from competitors with a physical presence in the State. It is essential to public confidence in the tax system that the Court avoid creating inequitable exceptions."

The rise of the Internet "has made Quill's original error all the more egregious and harmful," the court said, noting that Congress should not have "to address a false constitutional premise of this Court's own creation."

The majority decision came from Justices Kennedy, Ruth Bader Ginsburg, Samuel Alito, Neil Gorsuch, and Clarence Thomas. Dissenting justices were John Roberts, Stephen Breyer, Sonia Sotomayor, and Elena Kagan.

Shares of Amazon, Etsy, Wayfair, and other online retailers fell today after the ruling. "Traditional retailers like Target, Walmart, and Best Buy saw shares rise about one percent after the decision," CNBC wrote.

Amazon collects sales tax in all states that impose such taxes, at least for purchases from Amazon and its affiliates. Amazon generally doesn't collect taxes on behalf of third-party sellers that sell goods on Amazon, but it does collect taxes on third-party sales in Pennsylvania and Washington because of new laws in those states.

“Nightmare” to some, “fairness” for others

Some members of Congress objected to the decision. The ruling "is a nightmare for American businesses and small online sellers, who will now have to comply with the different tax rates and rules" of each jurisdiction, said a statement by US Reps. Bob Goodlatte (R-Va.), Anna Eshoo (D-Calif.), and Jim Sensenbrenner (R-Wis.).

"The dominant issues under debate in this case involved policy, not law," the representatives also said. "The briefs filed with the Court were filled with discussions of economics, the efficacy of software, trends in the retail industry, and myriad other non-legal questions. Congress is the appropriate institution to resolve these policy questions, not the Supreme Court."

South Dakota Attorney General Marty Jackley, who argued the case in front of the Supreme Court, applauded the ruling. "Today's landmark decision is a win for South Dakota and for Main Street businesses across America that will now have a level playing field and tax fairness," Jackley said.

"Our states are losing massive sales tax revenues that we need for education, health care, and infrastructure," he told the court during the case.

Wayfair said that it "welcome[s] the additional clarity provided by the Court's decision today. Wayfair already collects and remits sales tax on approximately 80 percent of our orders in the United States, a number that continues to grow as we expand our logistics footprint. As a result, we do not expect today's decision to have any noticeable impact on our business, as it may on other retailers who do not currently collect and remit sales tax."

Etsy said it hopes that Congress will "create a simple, fair federal solution for microbusinesses," like the people who sell items on Etsy's platform. "More than three quarters of Etsy sellers are businesses of one [person]. They have very different needs and challenges than larger online retailers," the company said.

The South Dakota law "applies to out-of-state retailers if they have more than $100,000 in sales or complete more than 200 transactions per year within South Dakota," Jackley's statement noted.