The US Supreme Court on Friday said it will consider whether businesses have to collect sales taxes on online transactions — a case that will affect how consumers are charged for their purchases on major e-commerce sites such as Wayfair, Overstock, and Amazon. The case, South Dakota v. Wayfair, will revisit a 1992 decision, Quill Corp. v. North Dakota, in which the court ruled remote sellers would have to collect state sales taxes only if they had a physical presence in a state, like a warehouse or an office. The court based its ruling, in part, on the “dormant commerce clause,” a legal doctrine that prevents states from interfering with interstate commerce unless authorized by Congress. The Court’s decision came down before both Amazon (founded in 1994) and eBay (1995) had become a significant presence in American life.

There’s a lot of cash at stake. The Government Accountability Office estimates that state and local governments could have collected up to $13 billion more in 2017 had they been allowed to require sales tax payments from online sellers, as Bloomberg notes. All but five states — Alaska, Delaware, Montana, New Hampshire and Oregon — impose sales taxes, meaning South Dakota v. Wayfair is a national issue.

Quill Corp. v. North Dakota, the earlier ruling, predates much of what has become a booming e-commerce industry today. According to the US Census Bureau, in 2016 total e-commerce sales in the United States were estimated at $394.9 billion, which accounted for 8.1 percent of total retail sales. For some perspective: Fifteen years before, in 2001, total e-commerce sales were estimated to be $32.6 billion, which at the time made up about 1 percent of total sales. According to research firm eMarketer, Amazon represents 43.5 percent of all US retail e-commerce sales; eBay accounts for about 6.8 percent.

A South Dakota law set off the court battle

In 2016, South Dakota passed a law that would allow it to collect sales taxes on out-of-state online retailers. The state government then filed suit to have the case heard by the higher courts — with an eye on overturning the Quill decision. “States’ inability to effectively collect sales tax from internet sellers imposes crushing harm on state treasuries and brick-and-mortar retailers alike,” South Dakota argued in its appeal to the Supreme Court.

South Dakota doesn’t have an income tax, so it’s particularly affected by the Quill decision. In August, the state said it had collected about $1.6 million since enacting the 2016 law and estimated it could be missing out on $50 million each year. Last year, the state faced a $33.7 million budget shortfall; South Dakota’s Gov. Dennis Daugaard said most South Dakota employees won’t see a raise for the next two years, pointing to low sales tax revenue as a problem.

The Supreme Court is likely to hear arguments in the springtime, with a ruling potentially by the end of June. Three justices — Clarence Thomas, Neil Gorsuch, and Anthony Kennedy — have in the past appeared skeptical of Quill, Bloomberg points out. In 2015, Kennedy, often a swing vote on the court, said the decision “now harms states to a degree far greater than could have been anticipated earlier.”

President Donald Trump has hit Amazon about this issue, but Amazon isn’t exactly the problem

While e-commerce companies collecting sales taxes isn’t the most well-known issue, it has been pushed into the spotlight by President Donald Trump. Over the past year he’s lobbed accusations at Amazon on multiple occasions, claiming the company skirts taxes — although that’s not exactly the case.

Amazon is doing great damage to tax paying retailers. Towns, cities and states throughout the U.S. are being hurt - many jobs being lost! — Donald J. Trump (@realDonaldTrump) August 16, 2017

The #AmazonWashingtonPost, sometimes referred to as the guardian of Amazon not paying internet taxes (which they should) is FAKE NEWS! — Donald J. Trump (@realDonaldTrump) June 28, 2017

As Bloomberg’s Spencer Soper, Matthew Townsend, and Lynnley Browning wrote last August, Amazon used to rely on the Quill ruling but has taken steps in recent years to change that. In its relentless quest to find efficiencies, the company has built warehouses all over the country, meaning that it has a physical presence in many states and has to pay sales taxes anyway; last year the company began collecting sales taxes in all states that levy them. Amazon still, however, avoids charging shoppers sales tax when they buy products from one of its third-party vendors, which makes up a significant portion of its business.

Amazon backs a nationwide approach instead of having to deal with taxing on a state-by-state basis, but other retailers aren’t so sure. Wayfair, Overstock, and Newegg are opposing South Dakota in its court fight, arguing that the burdens will fall primarily on small and medium-sized companies and asking instead for Congress to address the matter through legislation.

But some legislators say that Quill is the thing that’s keeping them from acting. A group of lawmakers — Sens. Mike Enzi (R-WY), Heidi Heitkamp (D-ND), Dick Durbin (D-IL), and Lamar Alexander (R-TN), along with Reps. Kristi Noem (R-SD) and John Conyers (D-MI) — signed a brief asking the Supreme Court to hear South Dakota v. Wayfair and overturn Quill. They say that Congress has been unable to reach a consensus on a legislative solution and that the impasse is the result of “structural advantages and disadvantages created by the Quill decision.” In other words: If Quill goes away, they’ll be able to fix the underlying issues.

Consumers may not appreciate seeing a new sales tax tacked on to their online purchases, but states are ready for more tax revenue. At the time of this writing, 35 states are supporting South Dakota’s court bid.