Shopify Inc (SHOP -0.48%), a leading e-commerce company, delivered a solid second-quarter 2023 performance, with revenue increasing 31% year over year and cash flows turning from negative $87 million to a positive $97 million.

Despite reporting solid numbers, Shopify's stock price has since fallen 21% after the earnings announcement. Should investors take this opportunity to buy the stock?

Person at desk working on laptop.

Image source: Getty Images.

The worst may be over for Shopify

In 2022, investors had concerns that Shopify's best days were behind it. That year, Shopify reported that gross merchandise value (GMV) grew just 12%, significantly lower than the 47% growth in 2021. GMV growth rate reached a low of 11% in the second and third quarters of 2022.

While Shopify turned around the GMV growth rate in the fourth quarter of 2022 with 13% growth, it took the company another two quarters of improving GMV growth rates -- 15%and 17% in the first and second quarters of 2023 -- to signal to investors that the worst might be over. These growth rates were nowhere near what Shopify delivered in 2021, but the steadily improving trend gave investors hope of a gradual recovery.

Revenue also grew at a respectable 31% in the latest quarter, a considerable improvement from the 21% revenue growth in 2022. Besides, management's decision to sell its logistics arm has brought back the focus it needs to grow its software business.

Overall, Shopify has repositioned itself to resume its hyper-growth mode in the next few years.

Its long-term prospects look bright

Shopify's short-term prospects may not look overly exciting, but its long-term growth opportunity remains intact.

First, it can continue expanding its e-commerce market share in the U.S. and overseas. For perspective, Shopify had only a 2% market share in the U.S. retail market in 2021, giving it plenty of room to expand. And if you include the global opportunity, the addressable market increases greatly.

Besides growing its market share in GMV, Shopify can also increase its take rate (revenue divided by GMV) from existing merchants. It has gradually improved this rate from 2.68% in 2018 to 3.08% in 2023, thanks to its efforts in continuously adding new services and tools to help merchants sell better, both online and offline.

To capitalize on these opportunities, Shopify needs to sustain its innovation to create new tools to help customers succeed. Historically, the tech company has been quite good at this, growing its offering from simple storefronts to other services like payment, financing, point-of-sale (POS) systems, the Shop app, and more.

If Shopify can continue to delight its customers with its ever-expanding suite of tools, it will naturally attract new merchants and retain existing ones. That will keep its growth machine spinning for many years.

But Shopify's stock remains expensive

After reaching its all-time-high price of $169, Shopify stock has fallen more than two-thirds to roughly $53. But despite the massive price correction, Shopify's stock remains pricey.

To put it into perspective, Shopify has a price-to-sales (P/S) ratio of 11 today, which is much lower than its five-year average of 28.7. But it is still unreasonably high compared to Amazon's P/S ratio of 2.6.

Shopify must execute flawlessly (and more) to justify its high valuation. If it fails to meet investors' high expectations, the stock price may fall to a lower valuation to reflect the new reality.

What does this mean for investors?

Shopify's latest quarterly performance indicates that the worst could be over for the company, even though it may take some time before Shopify returns to its good old days of hyper growth.

And with so many growth opportunities, it makes sense that investors are optimistic -- that's clear from its high stock valuation.

But here's the thing. A stock with good prospects doesn't necessarily translate into a great investment return. Investors must buy the stock at a reasonable price for a margin of safety and a reasonable upside opportunity.

While I'm not suggesting existing investors sell the stock, it will be risky for new investors to get on board now -- at least at the current valuation.