Many states have fallen behind the times as technology has moved a lot of shopping online. Considering there is no sales tax paid in online purchases where businesses have no physical brick-and-mortar stores, states are losing out of billions of dollars of revenue annually. Though, a decision by the U.S. Supreme Court on Thursday may now change that.

In South Dakota v. Wayfair (2018), the Court, in a 5-4 ruling, overturned previous cases wherein the “physical presence” notion of the Commerce Clause in Article I, Section 8 of the Constitution was the guiding basis on which cases were ruled involving state-mandated sales tax.

Let’s take into account an example of a multi-state retailer like Walmart. When sales are conducted, the store collects a sales tax from its customers and remits the tax to the states and localities in which its stores are located., a subsidiary of Walmart, is a web-based retailer selling products that are the same or very similar to those that can be found at brick-and-mortar stores across the country. shoppers, however, pay no sales tax unless they are located in Arkansas, California, Georgia, or Utah, the states in which has a physical presence.

University of Arizona law professor John A. Swain says this is because takes the position that it is protected by the “Dormant Commerce Clause,” as decided upon in Quill Corporation v. North Dakota (1992). If a company has no physical presence in a state, but still sells to customers in a certain state, it is not forced to charge a state-mandated sales tax

In his opinion in the Wayfair case, Justice Anthony Kennedy wrote that the previous decisions were flawed.

“Each year the physical presence rule becomes further removed from economic reality and results in significant revenue losses to the States. These critiques underscore that the physical presence rule, both as first formulated and as applied today, is an incorrect interpretation of the Commerce Clause,” he wrote in an opinion joined by Justices Clarence Thomas, Ruth Bader Ginsburg, Samuel Alito, and Neil Gorsuch, according to AP.

The case may come as a widespread blow to consumers who enjoy playing as little as possible, but it is a massive “win” for states that could use the extra tax revenue. States can now pass laws requiring sellers without a physical presence in the state to collect the state’s sales tax from customers and send it to the state.

Chief Justice John Roberts, who dissented along with Justices Stephen Breyer, Elena Kagan and Sonia Sotomayor, said that the Court’s previous decisions should have been kept in place. Roberts wrote that Congress, not the Court, should change the rules if necessary.

“Any alteration to those rules with the potential to disrupt the development of such a critical segment of the economy should be undertaken by Congress,” Roberts wrote his joined dissenting opinion.

Governor Dennis Daugaard of South Dakota said his state has been losing out on an estimated $50 million a year in sales tax that remains uncollected by out-of-state sellers. Lawmakers in the South Dakota, which has no income tax, passed a law designed to directly challenge the Supreme Court’s 1992 decision. The law requires out-of-state sellers who do more than $100,000 of business in the state or more than 200 transactions annually with state residents to collect sales tax and turn it over to the state.

South Dakota wanted out-of-state retailers to begin collecting the tax and ended up suing several of them, including the household goods company Wayfair, the defendant in the federal case.

Prior to the ruling, the White House urged the justices to side with South Dakota.

Now that sales tax can be collected from purchases involving online retailers, states will be able to recoup from decades of antiquated law.