Grocery delivery service FreshDirect is shopping itself after a bungled move to the Bronx has tarnished the company’s reputation and stunted its growth, The Post has learned.

Amazon and Walmart recently vetted FreshDirect’s financial and performance data as the grocer’s largest investor, JPMorgan, casts around for potential buyers, according to several sources, including former executives of the company.

It would be at least the third time that Amazon and Walmart — both of which are heavily investing in the grocery business — have considered acquiring FreshDirect, whose affluent customers and online delivery platform have long been attractive to rivals.

While service glitches have besieged the company since last year, when it moved to a sprawling new facility in The Bronx from Long Island City, FreshDirect still has fiercely loyal and wealthy customers in the Big Apple, one of the most coveted food delivery markets in the country.

In the past, FreshDirect brass have consistently brushed aside overtures — rebuffing offers from Amazon and Walmart in 2010 for $2.3 billion and $2.6 billion, respectively, according to a former executive with direct knowledge of those offers.

But now JPMorgan — whose asset management arm led a $189 million fund-raising in FreshDirect in 2016 and an additional undisclosed amount last year, according to research firm Pitchbook — wants out of its investment, sources said.

“JPMorgan is quietly shopping FreshDirect,” confirmed retail consultant Burt Flickinger, pointing to “FreshDirect’s poorly planned and executed move to The Bronx” as the catalyst. “FreshDirect was built to be a multi-regional operator across seven states and now it is a successful operator in four counties and one state,” Flickinger quipped, referring to Manhattan, Nassau, Suffolk and Westchester counties.

A former FreshDirect executive told The Post that Walmart and Amazon have been poking around FreshDirect for months. They have not made a move, he speculated, because they are “waiting for FreshDirect’s valuation to go down further.”

Instead of expanding to new markets, FreshDirect has been fighting to keep its current customers, many of whom became irate because of botched deliveries — while others dropped the service altogether, according to social media posts.

The situation became so dire that FreshDirect’s chief executive sent an apology e-mail to customers a year ago, conceding that the transition to The Bronx “has not been as smooth as we planned” and that the company was focused on earning back customers’ trust.

The delivery snafus were largely the result of a new technology platform for FreshDirect’s pick-and-packing functions, which control miles of conveyor belts in its Bronx warehouse. The new platform just didn’t work with the customer-facing software, according to a former executive with knowledge of the issues.

Out-of-stock notifications, missing items from orders and late deliveries plagued the company for months — and are still a problem but on a smaller scale now.

The fiasco cost FreshDirect’s co-founder and chief executive, Jason Ackerman, his job on Sept. 6, 2018, when he abruptly left and Chief Merchandising Officer David McInerney succeeded him. McInerney, a chef who cooked for Greenwich Village restaurant One if by Land, Two if by Sea, joined the company in 2000, a year after it was founded. He was given the title of co-founder about five years ago.

Ackerman’s uncle, Peter Ackerman, a former Drexel Burnham executive who is also a director of FreshDirect, was its largest investor for many years. But his stake is now junior to institutional money, according to multiple sources.

Historically, the Ackermans have not been interested in selling the company, which they’d hoped to take public one day. But it has since lost its edge due to the Bronx blunders and increased competition from food delivery apps and traditional supermarkets upping their delivery game.

In its early days, “FreshDirect was 10 to 15 years ahead of everyone else,” Flickinger said. “They are still attractive at a deeply discounted price,” the analyst said.

FreshDirect has already cut costs twice this year, including slashing roughly one-third of its staff. It also consolidated its one-hour delivery service, Foodkick — a stand-alone division that had long been a FreshDirect “growth engine” — into the larger company, according to several sources.

For Walmart, FreshDirect could be its ticket into Big Apple, where labor groups have long blocked it from opening a store.

Walmart’s interest in the grocery delivery company goes back to the early 2000s, when executives of the discount shopping chain spent three days at FreshDirect’s Queens headquarters in hopes of a partnership, said a former executive. The pitch was for Walmart to help FreshDirect “cookie cutter” its business in other major markets, this person said.

FreshDirect’s labor union ties could also hinder a sale to Walmart and Amazon, as both are union averse, sources said.

JPMorgan and Amazon declined to comment. FreshDirect and Walmart didn’t return requests for comment.