BILLIONS of dollars and long-standing interstate e-commerce rules are at stake in a case that came before the justices on April 17th. The case revisits an old Supreme Court rule that retailers shipping goods to states where they have no physical presence cannot be forced to collect sales tax from their customers. This standard is outdated, South Dakota's attorney-general told the justices, and deprives states of “massive sales tax revenues that we need for education, healthcare and infrastructure”.

The conflict in South Dakota v Wayfair Inc arose in 2016 when the Midwestern state noticed that more of its residents were shopping online. In defiance of a quarter-century-old Supreme Court precedent, South Dakota tried to shore up its declining revenues by imposing sales-tax collection on far-flung stores doing more than $100,000 of business, or conducting more than 200 transactions, in the state.

When the conflict hit the lower courts, South Dakota’s law was struck down as a violation of the constitution’s Commerce Clause in line with Quill v North Dakota, a 1992 ruling. But the state pinned its hopes on Justice Anthony Kennedy’s comment in 2015 that Quill was “doubtful” and ripe for reconsideration. “[D]ramatic technological and social changes” in America’s economy, he wrote, along with “startling” state budget shortfalls, cast the Quill-mandated sales-tax regime in a less appealing light.

It would take five justices to overrule Quill and permit states to force out-of-state retailers to step up and collect tax. Going into the hearing, conservative Justices Neil Gorsuch, Clarence Thomas and Kennedy all seemed inclined to do that. The oral argument added a surprise fourth justice to that list: Ruth Bader Ginsburg, the court's fiercest liberal. In her questioning of George Isaacson, the lawyer for several online stores including Wayfair, a homewares company, she repeatedly called Quill “obsolete”. Requiring an “out-of-state seller to collect tax on goods shipped in-state” is “equalising sellers”, she said.

In response, Mr Isaacson said the Commerce Clause seeks to ensure a “single national marketplace that is free and accessible to all participants”. When the court first weighed in on the question in 1967, America had 2300 different sales-tax jurisdictions. That number rose to 6000 by the time Quill was decided and stands at over 12,000 today. So any store selling wares over the web would face the onerous task of calculating various items’ precise tax rates for countless addresses across the country. Smaller retailers may not be up to the task.

Exactly how burdensome and expensive the accounting might be is a matter of dispute. Justice Sonia Sotomayor pointed to one brief claiming the cost would be as high as $250,000; the lawyer for South Dakota said it would be closer to “$12 a month for 30 transactions”. Online software companies filed a friend-of-the-court brief touting services like TaxCloud and WooCommerce that might do the job for free—but when Wayfair and the other retailers tested these websites, they quickly found them “rife with errors”.

These and other conflicting claims seemed to befuddle Justice Stephen Breyer, who may hold the key vote. “When I read your briefs, I thought absolutely right”, he told the lawyer for South Dakota. “And then I read through the other briefs, and I thought, absolutely right. And you cannot both be absolutely right.”

The justices also pointed to disparate predictions of how much states stand to gain if the court abandons Quill. South Dakota says it would reap another $50m in tax revenues through its 2016 law and that other states would see increases totaling $34bn, whereas the companies cite Government Accountability Office estimates closer to $8-13bn. Whatever the figure, a lot of tax dollars, and a big consumer perk, are on the line when the Supreme Court hands down its decision in May or June.