For years, consumers around the country have enjoyed an internet-age perk: buy online instead of on Main Street, and you can often avoid paying the sales tax.

That’s no small thing in California, which owns the nation’s highest state sales tax and the ninth-highest combined state and local rate. The state was losing hundreds of millions of dollars in online sales tax revenue every year.

But starting Monday, what critics have called an unfair advantage for out-of-state online sellers at the expense of brick-and-mortar stores will largely disappear in California, and that’s no April Fool’s joke.

“All it means to California residents today is when you buy online, more often you’ll see sales taxes are added,” said attorney Betty Williams, whose Sacramento law firm specializes in tax matters.

Thanks to a U.S. Supreme Court decision last year in a South Dakota case, California is joining some 30 other states in requiring out-of-state retailers that were previously exempted to collect sales and use taxes.

For a state said to have the world’s fifth largest economy, there’s a lot of money at stake. Gov. Gavin Newsom’s proposed budget expects the change to deliver an additional $219 million to state coffers from April 1 to June 30 and $554 million over the following fiscal year.

Before last year, sales tax rules for out-of-state retailers were governed by a 1992 U.S. Supreme Court decision, Quill Corp. v. North Dakota, that allowed sales tax collection only from sellers that maintained a physical presence in the state. That could include a store, warehouse, distribution center, salespeople or contractors.

A 2011 state law added that remote sellers that are within the same corporate family as in-state businesses, or that have in-state affiliates, are subject to sales tax collection. State officials also took steps to remind taxpayers that they ultimately are responsible for paying sales and use taxes, even on online purchases where the retailer doesn’t collect it for them.

But enforcing collection from millions of individual taxpayers potentially owing small amounts of unpaid sales and use tax each year is impractical. And many blamed the different tax rules governing online and in-person sales for contributing to a “retail apocalypse” of store closures.

State officials have complained that online retail behemoth Amazon doesn’t collect sales tax on behalf of the third-party businesses that sell products through its website.

Amazon said the company collects and remits state and local taxes in every state as required by law. The company added that as states pass additional legislation that authorize and require companies like Amazon to collect on behalf of third-party sellers, it will collect and remit taxes on those sales.

Williams said the obligation is on the out-of-state retailers to start collecting and paying the tax. With Amazon, whether it considers a retailer a “vendor” or “seller” with Amazon can make a difference on who collects tax, she added.

The Supreme Court’s 2018 South Dakota v. Wayfair Inc. decision upheld that state’s law imposing sales tax on out-of-state sellers with more than 200 transactions or $100,000 in gross revenues in the state, effectively eliminating the earlier physical-presence requirement.

Justices in the 5-4 majority effectively argued that times have changed.

“The Quill Court did not have before it the present realities of the interstate marketplace, where the Internet’s prevalence and power have changed the dynamics of the national economy,” the majority opinion said. “The argument, moreover, that the physical presence rule is clear and easy to apply is unsound, as attempts to apply the physical presence rule to online retail sales have proved unworkable.”

State officials said the court decision will close a loophole that was crushing retail stores.

“California will now require more out-of-state retailers to collect and remit taxes just as brick-and-mortar retailers have done for decades,” said Nick Maduros, director of the California Department of Tax and Fee Administration, in a December statement announcing the coming new rules. “With the Supreme Court ‘s decision in Wayfair, California is able to help level the playing field for California businesses.”

California officials mirrored South Dakota’s law for applying sales tax to out-of-state sellers.

The new collection requirement applies if the retailer’s sales into California exceed $100,000 or 200 separate transactions during the preceding or current calendar year. It is not retroactive and applies only to sales made on and after April 1, 2019. Local sales taxes are included in the requirement.

The change does not increase tax rates or create new taxes. Retailers who already were required to collect California sales and use tax before April 1 will see no change in their obligations.

The California Chamber of Commerce had no comment Friday on the pending change. In an online post, the business group urged the tax and fee administration to “refrain from implementing a new tax requirement until the Legislature finalizes its post-Wayfair legislation.” It cited concerns about “uncertainty and unnecessary litigation and costs on business.”

State lawmakers had considered raising the threshold for remote sales qualifying for the tax requirement but ultimately took no action.