E-commerce stocks have been some of the worst performers in the market over the last year, but online retail spending is a massive market estimated to reach over $7 trillion in annual sales by 2025, according to eMarketer. While online spending could remain under pressure in the near term, investors who invest in leading brands and hold patiently through the bumps in the road should do very well over the long term.

If you have some extra cash this month, there are good reasons Shopify (SHOP -2.37%) and eBay (EBAY -0.14%) could be timely buys.

1. Shopify

Shopify's expensive stock got slammed by the slowing growth in e-commerce last year, but revenue growth has started to accelerate. The company's 26% year-over-year revenue growth in the fourth quarter looks strong for a stock that is trading at its lowest price-to-sales multiple since it started trading in 2015. The stock is already up roughly 36% year to date. 

Shopify offers a powerful suite of tools that allow a business to start, grow, market, and manage their online storefront. This is more valuable in the current environment of rising interest rates and inflation. Shopify's top-line growth never slowed further than 16% last year, and even at that low point in the second quarter, the company's revenue was up 53% on a compound annual basis over the last three years. 

SHOP Chart

SHOP data by YCharts

Shopify provides a single platform to manage and market products across mobile, social media, business-to-business, and the web. It provides these tools at low cost through a cloud-based subscription plan, where the majority of merchants are on plans that cost less than $50 per month. 

Small businesses are not going to shut down their e-commerce channel just because of near-term headwinds in the economy. These businesses are making a long-term investment in the future of commerce, and they are choosing Shopify.

"We closed out 2022 with more merchants growing their businesses on Shopify, and the caliber of brands choosing Shopify is not slowing down," President Harley Finkelstein said during the fourth-quarter earnings call

Indeed, even big brands are joining the platform. Mattel will be bringing more than 400 brands to the platform, and Shopify also continues to make headway internationally, launching Reebok, Skechers, and Sony Music Entertainment in new markets last quarter. 

The recent acceleration in revenue and gains with major brands are good reasons to consider buying the stock while it's down. Shopify is clearly not done growing. The global e-commerce market is too big.

2. eBay

eBay hasn't produced the robust growth of Shopify. But unlike other e-commerce stocks, eBay pays a dividend and generates healthy profits relative to the top line. eBay's slower rate of growth is why the stock trades at a conservative valuation of around 13.8 times trailing free cash flow. But management's strategy to invest in higher-growth categories, like luxury goods, looks promising.

eBay is gradually transforming from a virtual garage sale to a marketplace catering to a new generation of shoppers. Millennials are driving strong demand for secondhand sales, especially luxury watches. eBay launched an authentication service for fine jewelry last year. It also offers the same service for sneakers, handbags, and trading cards -- what eBay calls "focus" categories. 

"We have observed notable turnarounds in GMV growth since we launched authentication, improved the product experience, and drew awareness to the great inventory in these categories," CEO Jamie Iannone said during the fourth-quarter earnings call. 

While eBay's gross merchandise volume (GMV) -- the value of all items sold in the marketplace -- increased just 2% in the fourth quarter over the same period in 2019, luxury categories have increased at roughly double-digit annualized growth rates since 2019. 

eBay's total revenue declined about 1% in 2022 over 2017. That doesn't look very exciting, but the double-digit growth in focus categories shows that the business is changing for the better. 

Meanwhile, eBay generates $1.8 billion in free cash flow on $9.8 billion of revenue. It pays roughly a quarter of its annual free cash flow in dividends, bringing the yield to an attractive 2.12%. 

As management continues to invest behind the attractive growth of secondhand luxury goods, eBay could look very different in 10 years than it does today. The future growth from these initiatives are not reflected in the stock's valuation, which could lead to significant outperformance relative to the broader market.