In recent tweets, President Trump has urged the U.S. Postal Service to charge Inc. more to deliver packages to consumers — a potentially costly blow because the e-commerce giant uses the federal agency for an estimated 40 percent of deliveries.

Reducing Amazon's reliance on the USPS wouldn't be simple — and may not even be necessary — but the world's largest online retailer has been steadily putting together a shipping operation that one day could handle most of its deliveries and help offset a Trump-inspired disruption.

The newest piece of the emerging distribution network: Whole Foods, whose locations Amazon is bent on turning into combo grocery store-warehouses.

"They now have 460 Whole Foods locations and can increasingly use that footprint to expand their logistics efforts," says Tom Forte, an analyst at DA Davidson & Co. In the meantime, he adds, Amazon could pay FedEx Corp. and United Parcel Service Inc. more to handle deliveries "while it builds out its own delivery network."

On Tuesday, Trump returned to the fray with a tweet saying: "I am right about Amazon costing the United States Post Office massive amounts of money for being their Delivery Boy. Amazon should pay these costs (plus) and not have them bourne by the American Taxpayer. Many billions of dollars. P.O. leaders don't have a clue (or do they?)!"

The president's claim is unsubstantiated. While its contract with Seattle-based Amazon is confidential, the Postal Service has argued that its e-commerce services benefit the organization and its mail customers. It is legally prohibited from charging shippers less than its delivery costs. Further, taxpayers don't directly support the Postal Service's operations.

Also, Trump has been stepping up criticism of political coverage by the Washington Post, which is owned by Amazon founder and chief executive Jeff Bezos.

Amazon stock has tumbled about 12 percent — wiping out $75 billion in value — since news broke last week about Trump's "obsession" with the company, followed by tweets regarding sales taxes, retail closures, and postal rates.

Amazon has been experimenting with a range of delivery options. In 2015, the company launched Amazon Flex, an Uber-type app that lets independent contractors make Amazon deliveries in their own cars. Last year, the company began testing a program called Seller Flex that lets Amazon oversee the pickup and delivery of packages from warehouses of third-party merchants selling goods on its site. It is testing deliveries by autonomous drones that eliminate the labor cost of sending a driver. And it has experimented with its own employee delivery drivers through its Amazon Fresh grocery delivery service.

Since acquiring Whole Foods last year, Amazon has been putting lockers at stores so shoppers can pick up or return merchandise. Now the company is searching for bigger Whole Foods locations in cities that can serve as both grocery stores and urban distribution centers for delivering goods to online shoppers more quickly, according to someone briefed on the plans.

Whole Foods is also working with Regency Centers Corp., one of its largest landlords, on a project to convert parking areas at existing stores into stalls for Amazon delivery contractors to load up their orders, says the person, who asked not to be identified because the initiative is private.

Disentangling itself from the Postal Service wouldn't be easy. Amazon has built 35 "sortation centers" around the country where packages are grouped by zip code and delivered to post offices for the final mile of delivery to shoppers' homes. Amazon also benefits from cheap bulk rates — helping it save approximately $2.6 billion a year compared with what it would pay UPS and FedEx for those deliveries, according to a 2017 Citigroup report.

How worried should Amazon be about the relationship? While Trump says the USPS loses a "fortune" delivering Amazon packages, the company is a valuable customer that has helped shore up the money-losing federal agency. Moreover, the USPS's board of governors value their independence and may not easily succumb to political pressure.

"If the postal service were no longer an option for Amazon tomorrow," Forte says, "it wouldn't put them under because they continue to roll out their own delivery efforts and they have a lot more opportunities with Whole Foods."