Consumers Love Food Delivery. Restaurants and Grocers Hate It.

Consumers expect to order books, toys, shoes and anything else they want online and have it show up at their doors quickly and inexpensively. Restaurants and grocers are rushing to satisfy the exact same demand. They’re having a hard time.

A hungry customer in Denver might order a $9.99 Cuban sandwich from Panera Bread Co., which can arrive at her door in about 30 minutes.

The problem for Panera is that each delivery costs about $5 after accounting for labor, gas and packaging. Yet to avoid turning away customers, it continues to charge a flat delivery fee of $3 per order in most markets, which means they have to sell a lot more per order to absorb those costs.

Food delivery is proving to be a thorny, expensive and crucial puzzle for restaurants, grocers and investors. Billions of dollars have been spent in a quest to build services that reliably move fresh food from one place to another, yet many in the business wonder if they will ever get the economics right. Most delivery orders remain unprofitable.

Companies are willing to put up with losses, for now, because they aren’t seeing much growth inside their stores. And while delivery currently represents only a tiny fraction of overall food-buying, restaurant and supermarket companies expect people to increasingly shop that way. Big-city dwellers remain the largest consumers of food delivery, but the phenomenon is spreading to suburbs and smaller urban areas.

“Customers have raised their expectations. The whole framework has changed,” said Frans Muller, chief executive of Royal Ahold Delhaize NV, which is trying to boost sales of its Peapod grocery delivery service. Peapod has previouslysaid it is profitable in only a handful of its markets.

Online grocery sales are expected to grow to around $86 billion in 2022 from $17 billion in 2017, according to a report from UBS Group AG. Investment firm William Blair & Co. estimated sales of online restaurant delivery will grow to $62 billion in 2022 from about $25 billion today.

For now, it’s an expensive slog. Kroger Co. reported lower profit on Thursday for its latest quarter, in part due to investments of hundreds of millions of dollars in online operations, and its shares fell 10% that day on the news.

Although grocers and restaurants have their own separate challenges, they face similar problems.

Both are dependent on foot traffic and have fallen behind other retailers in adopting order-taking technology. Both operate on low margins—typically 15% to 19% for restaurants for dine-in customers, and 1% to 3% for grocers—and customers are only willing to pay so much for convenience.

It costs supermarkets an average of $10 an order to deliver food, but grocers only recoup around $8 from customers because charging more risks turning off shoppers, according to a survey of supermarket executives by consulting firm Capgemini. Only 1% of 2,874 consumers surveyed by the research firm were willing to pay the full cost of grocery delivery.

And 85% of consumers aren’t willing to pay more than $5 for restaurant delivery, according to a recent survey of 2,000 fast-food and fast-casual customers conducted by online ordering platform Tillster. Inc.’s purchase of Whole Foods in 2017 and its rapid rollout of grocery delivery across those stores intensified the pressure for other supermarkets to offer delivery. Separate from Whole Foods, Amazon is now planning to push into the grocery business with dozens of new stores in several major cities, as recently reported by The Wall Street Journal—a sign of how difficult food delivery is when done only online.

Along with Kroger, Target Corp. and Walmart Inc. are spending billions of dollars to develop their own delivery systems through acquisitions and investments. The retailers have seen their margins suffer in recent quarters as a result.

“I’ll be honest, it’s not easy,” John Mulligan, chief operating officer for Target, said in an interview. Target bought online grocery service Shipt Inc. for $550 million in 2017. “From a pure relevance standpoint, you have to figure it out, because that’s how shoppers are going to interact with you,” he said.

Walmart now offers grocery delivery through nearly a half-dozen third parties and through, an e-commerce site it bought for $3.3 billion in 2016. Delivery sales are growing, but the company says its e-commerce losses are expected to increase this fiscal year.

Many grocers have had to invest money to reconfigure their stores, installing coolers for delivery orders, creating dedicated checkout lanes for online-order shoppers and redesigning backrooms and parking lots. Online orders draw down inventory in ways that grocers are still working to predict, which risks cannibalizing in-store sales.

Unlike easy-to-ship household items, groceries must be packaged carefully and sent in refrigerated trucks. That makes the “last mile” of the delivery process—from the warehouse to the consumer’s door—a costly, often perilous journey. The average online grocery order contains dozens of items, with different temperature and handling requirements.

Restaurant meals must likewise be packed in special containers and delivered within a short window.

Restaurants can’t ignore delivery. Nearly a third of restaurant meals in the year ending in September were consumed at home, up 2% from the previous year, according to the NPD Group Inc. The number of meals eaten at restaurants was flat over the same period.

Yet few chains can afford to do delivery themselves, due to the cost of developing order-taking technology and of employing drivers. Restaurants need to generate at least 25% to 30% of their orders from delivery for the labor economics to make sense, according to Dylan Bolden, senior partner at Boston Consulting Group.

Panera employs its own drivers to handle deliveries in most cities. The chain spent six years and an estimated more than $100 million to develop the technology to process its own online orders. Its investment cut into profits for three years, until the effort began to pay off in 2016.

The company now derives 10% to 15% of its sales from delivery in markets where it has been offered for a long time. “We are substantially better off doing delivery than not,” Chief Executive Blaine Hurst said.

Panera and some other restaurants say that for now, delivery is attracting diners who wouldn’t otherwise come to eat in and that the extra sales volume they’re generating from delivery offsets the cost. Also, when people order delivery, they tend to order for larger groups, so the average check is higher than it is for dine-in orders.

To help fulfill orders, many restaurants have turned to one of roughly a dozen delivery services, such as Grubhub Inc., the oldest and largest in gross food sales, as well as DoorDash Inc. and Uber Technologies Inc.’s Uber Eats.

Venture-capital firms put $5 billion into U.S. food and grocery delivery services last year, more than four times the amount they invested in 2017, according to data provider PitchBook Data Inc. Some, including Postmates Inc., are considering public offerings.

Chicago-based Grubhub, founded in 2004 and now valued at $7 billion, allows diners to order food from more than 105,000 restaurants in more than 2,000 U.S. cities and London. After investing heavily in advertising due to increasing competition and spending money to recruit drivers and bring in diners in new markets, Grubhub swung to a loss in the fourth quarter. Its adjusted profit per order was $0.98, down from $1.57 in the third quarter.

A Grubhub spokeswoman said, “We expect our marketing investment will result in more orders throughout 2019 and our new delivery markets will become more efficient throughout the year.”

Newer entrants such as DoorDash, founded in 2013, have attracted venture capital that have enabled them to expand rapidly. After another funding round last month, DoorDash is now valued at $7.1 billion and is available in all 50 states.

Supermarkets have also been turning to outside firms, particularly Instacart Inc. and Target’s Shipt. The companies allow shoppers to order groceries from multiple supermarkets signed up in a given area, and sends gig economy workers to pick up and deliver orders.

Instacart, the largest independent third-party grocery service with an estimated $2 billion in sales in 2017, continues to lose money on orders, according to people familiar with the metrics. Nilam Ganenthiran, Instacart’s chief business officer, said the company averages profitable margins on orders when not accounting for administrative expenses.

Third-party services currently handle 52% of online restaurant orders, according to William Blair. They handle delivery for around half of the online grocery market for food, according to consulting firm Pentallect Inc.

Food sellers pay the services an average fee of 10% to 25% on each order, which means the actual deliveries often lose money. Better placement on the services’ websites or apps costs even more.

KFC and Taco Bell work with Grubhub to handle delivery. Scott Catlett, general counsel of Yum Brands Inc., owner of the two chains, said offering delivery is essential to keep convenience-seeking consumers. “Brands that don’t provide an easy experience ultimately won’t win in the end, so we’re very focused on the concept of easy,” he said.

Texas Roadhouse Inc., a steakhouse with more than 500 restaurants in the U.S., decided not to offer delivery after tests with two services last year. Consumers complained that the food quality wasn’t good and that prices were higher than in the restaurants.

Scott Colosi, president of Texas Roadhouse, said he is skeptical that delivery sales will be great enough to offset the cost. “I mean, people will try it when it’s new, but how long will they do it?” he said.

McDonald’s Corp. started using San Francisco-based Uber Eats for delivery in January 2017. In a survey that a newly formed association of franchisees conducted of its members in January, 565 respondents said that delivery is not contributing positive net cash flow to the business, while 198 said it is.

A McDonald’s spokeswoman deferred to a recent earnings call, in which executives said approximately 70% of delivery orders come from people who don’t come into the restaurant to eat, and that the average check for delivery orders is around twice that of in-store orders.

When an order of fries shows up cold or a bunch of lettuce arrives wilted, consumers tend to blame the food seller, not the service. Many restaurants and grocers that work with third parties also lose control over customer data, which food apps can use to drive customers to other outlets.

Some chains are taking a hybrid approach by handling the order-taking through their apps but outsourcing the actual delivery to third-party services, which saves them 10% to 15% in commission fees.

Large chains such as Yum Brands have the scale to negotiate favorable terms, unlike smaller chains or independents.

“We said up front that access to data is table stakes and we wouldn’t consider any deal that doesn’t include that,” said Yum’s Mr. Catlett. Yum also arranged to pay Grubhub a per-order commission fee that Mr. Catlett said is “nowhere close to 20% to 30%.”

Grubhub Chief Executive Matt Maloney said he understands restaurants’ fears about losing customer data and decided the key to their mutual long-term success would be to come up with a way to share data with restaurants.

Theresa Tepper, a 41-year-old Manhattan public relations professional who orders groceries from FreshDirect LLC and takeout from Grubhub’s Seamless service, sees little of the downsides of low-cost delivery.

“Delivery makes my life so much easier,” she said.