SACRAMENTO, Calif. (AP) — Online retailer has tried to become all things to all consumers, but in California, it is about to take on a role it has fought against for years: tax collector.

The change, which takes effect this weekend, comes after years of bitter back and forth between the world’s largest online mall and the California Legislature over whether Internet retailers should have to impose sales taxes on customers. The two sides reached a deal in 2011 that included a one-year grace period set to end Saturday.

The looming deadline has spurred at least some consumers into impulse-buying mode, making big-ticket purchases and stocking up on essentials before the tax collection kicks in.

“Even the mailroom is laughing at me,” said Derek Daniels, 37, who has had Amazon packages delivered to his Los Angeles office every day this week. He’s loading up on household supplies like trash bags, and on birthday and Christmas presents for his Superman-loving 2 year-old.

“We are hoping he won’t fall in love with Batman by the time November rolls around,” Daniels said.

The deadline spurred San Diego artist John Purlia to finally buy that Samsung flat-screen television that had been sitting in his Amazon shopping cart for months. He also picked up four CDs, an external hard drive and an oddly decorated $17.99 kitchen cutting-board — a gag gift for his sister.

“The TV was the motivating factor and the other stuff came along for the ride,” said Purlia, 52. “I know I’m going to be back at Amazon before Saturday looking to take advantage of this. It’s like the final days of a sale.”

Technically, Purlia and Daniels owe taxes on all of this: California residents are supposed to calculate what they owe and send it directly to the state. But hardly any do.

As Amazon has grown in popularity, lawmakers have complained that it was depriving the state of millions of dollars by refusing to charge taxes at checkout. Amazon argued it was not obligated to collect taxes because of a 1992 U.S. Supreme Court ruling that prohibits states from forcing businesses without a physical presence in the state to do so.

The e-commerce giant said it did not have a physical presence in California because it does not have warehouses here.

Similar fights have played out in other states, with Amazon sometimes threatening to shutter distribution centers to be able to continue selling tax-free goods.

Now Amazon is making similar treaties across the country, paving the way to start opening warehouses and offering faster shipping in areas where tax disputes had previously prevented it from putting down roots. The company now collects sales taxes on orders shipped to seven states, including New York and Texas, and has agreed to start imposing levies in six more.

The resolution of Amazon’s tax fight in California has allowed the company to start building a network of warehouses to cut shipping times to customers in the nation’s most populous state. Soon, California customers will receive Amazon shipments from warehouses in San Bernardino, which is near Los Angeles, and Patterson, near the San Francisco Bay Area — instead of from Reno, Nev. or Phoenix. Each new center is expected to bring hundreds of jobs to California, where the unemployment rate is the third highest in the nation.

Its expansion into California may one day allow Amazon to offer some customers here same-day shipping, as it does in 10 U.S. cities, including Boston and Seattle.

To San Francisco product manager Reid Butler and other hardcore online shoppers, that is the Holy Grail.

“For me, most my friends and family, same-day delivery could be a big blow to our retailers down the street,” said Butler, 32.

As the tax deadline nears, Butler is stocking up on enough soap, printer ink and baby formula to last until the day he can scan a barcode in the morning and receive his toilet paper that afternoon.

The brick-and-mortar stores that pushed for the “Amazon tax” to level the business playing field hope the changes will end the dispiriting practice of “showrooming,” when people browse electronics or books in a store but make their purchases online.

“It will remove one incentive for not buying local,” California Retailers Association president Bill Dombrowski said. “Retailers are looking forward to it, but we don’t go out and buy champagne on September 15.”

Colin Sebastian, an analyst with Baird Equity Research, said Amazon will probably be able to make up for the loss in sales tax advantage by carpeting the state with distribution centers.

“The irony in this is the closer Amazon gets to its customers, the more success it seems to have,” he said.

Amazon spokesman Scott Stanzel said the company will continue to offer lower prices, even without the sales tax advantage, and is not worried about losing business. He would not say whether the tax deadline has affected sales.

More change may be on the way. The company is lobbying Congress to cut through the web of state-specific rules and devise a national policy for Internet taxation.

Sales tax rates in California reach 9.75 percent and are among the highest in the country. The new rules, which may affect more than 200 out-of-state businesses, are expected to bring in more than $200 million annually, with at least $80 million coming from Amazon alone.

California’s tax authority is preparing to hire 30 new specialists to make sure the state collects the revenue it is due. Jerome Horton, chairman of the state Board of Equalization, said the change will allow out of state companies to “contribute their fair share” toward schools and other public services.

Amazon has been tax-free for nearly two decades; an adult lifetime for some customers.

Amateur photographer Joe Chin, 27, saved more than a hundred dollars last week when he used Amazon to buy a $1,400 Fujifilm digital camera. A world without tax-free shopping will be an adjustment, he said.

“It’s kind of like going back to how it was when I was a kid,” he said.

(© Copyright 2012 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)