E-commerce stocks appear to be deeply out of favor on Wall Street at the moment. The pandemic-driven spending boom that sent millions of shoppers online caused a long growth hangover for leading companies in the space. Slowing growth as the pandemic eased was exacerbated by the weakening economy over the last year.  

However, investors would do well to focus on the long-term trend of e-commerce spending. Global e-commerce increased from 15% of total retail sales in 2019 to 22% in 2022, according to analysts from Morgan Stanley. These analysts see further investments in logistics, fulfillment capabilities, and mobile adoption driving more expansion over the long term.

Investors don't need to look further than Coupang (CPNG -0.52%) and Amazon (AMZN 3.43%) for good investment ideas. These two top e-commerce stocks have the ability to deliver stellar returns for investors thanks to their current low share prices. Here's why they are solid long-term investments.

A piggy bank with five ascending stacks of coins in front of it, with the tallest stack having a seedling on top that's being watered by a person's hand.

Image source: Getty Images.

1. Coupang

Coupang is a leading e-commerce platform in Asia, with 18 million active customers. That is out of a population of 51 million in South Korea alone, leaving plenty of room to expand. Coupang is headquartered in the U.S. but also has operations in Japan, Taiwan, Singapore, and China, providing a vast runway of growth over the long term. 

The stock is down 76% from its IPO price in 2021, but the company's growth could help the shares rebound in the new year. Since 2019, revenue has climbed from $5.8 billion to over $20 billion, and momentum looked quite strong over the last year. In the third quarter, Coupang reported a currency-neutral revenue increase of 27% year over year. 

Coupang's growth strategy is similar to Amazon's. In the early years of Amazon's expansion in the U.S., it invested heavily in building a vast fulfillment infrastructure to get closer to the customer, which was crucial to getting the business to where it is today with same-day and next-day delivery.

Coupang is following a similar playbook. It is reinvesting all gross profits in technology and fulfillment capacity. Specifically, Coupang is focused on improving its Rocket shipping service, offering better deals for customers, expanding its selection, and building its free video content library in streaming. 

While Coupang is still unprofitable, the returns on these investments are starting to kick in. In the most recent quarter, management reported the third consecutive quarter of improving margin. Investors should expect growing profits over time from continued investment in automation, supply chain optimization, and the use of advanced technology -- such as machine learning -- for predicting consumer spending patterns, which will help the company better manage its inventory and lower costs.

With Coupang's profitability marching higher on top of solid top-line growth, the stock could rebound in 2023 and deliver market-beating returns over the long term.

2. Amazon

Investors should never underestimate the online tech titan. Amazon is well-positioned to benefit from the tailwinds in e-commerce spending.

The market punished Amazon for slowing growth and lower profitability as management continues to invest in expanding fulfillment capacity, Prime Video content, and data centers for Amazon Web Services (AWS), where it continues to lead the cloud services market. But the stock's 50% drop from its all-time high could be selling the company's future way too short.

Morgan Stanley sees the e-commerce market growing from $3.3 trillion in 2022 to $5.4 trillion by 2026. Looking over the next decade and beyond, it's clear there will be trillions of dollars flowing to online merchants. Amazon is better positioned than anyone to capture the lion's share of that opportunity with its growing footprint of fulfillment centers and transportation fleet.

Amazon held a 38% share of e-commerce spending in the U.S. alone as of June 2022, according to Statista. Walmart and Apple are in a distant second and third place, with 6.3% and 3.9%, respectively. That is a huge gap that reflects the grip the tech giant has on its customers' wallets.

Over 200 million Prime members utilize the Amazon ecosystem that includes free grocery delivery, entertainment (Prime Music and Video), and an unbeatable selection of goods, with management always looking for new ways to keep gaining wallet share.

To top it off, Amazon is still in the early days of growing AWS as organizations continue migrating their data systems to secure off-premise servers for storage and analytics. AWS accounts for 15% of the company's sales but reported a 27% year-over-year revenue increase in the third quarter. This is why Amazon is still a great buy, especially with the stock trading at its lowest price-to-sales valuation since 2014.