On the same day that Shopify (SHOP 0.23%) released its first-quarter 2023 earnings report, its CEO also released a letter announcing the company will be releasing 20% of its workforce and selling Shopify Logistics to Flexport. Shareholders liked hearing that it ended its dreams of being a logistics company and is focusing more on its core mission to "make commerce better for everyone." Additionally, investors cheered when the company beat analysts' revenue and earnings expectations, resulting in the stock jumping 23.83% higher. However, although Shopify's long-term future looks bright, you should hold off buying the stock today. Here's why.

Why you should be cautious

The stock has a rich price-to-sales (P/S) ratio of 12.37, higher than the S&P 500's P/S ratio of 2.4. Its valuation is also much higher than other publicly traded e-commerce infrastructure companies, as shown below.

SHOP PS Ratio Chart

SHOP PS Ratio data by YCharts

Most of Shopify's customers are early-stage businesses on monthly subscription plans that cost less than $50. This fact may not be a concern when the economy is strong and the market is bullish. However, investors should be cautious about the possibility of a recession. Small businesses are likelier to fail during a slowing economy, which could wipe out a meaningful portion of Shopify's customer base. Additionally, a recession would likely slow retail spending, negatively impacting sales on Shopify's platform and lowering revenue and profitability, resulting in its valuation dropping like a rock.

While Shopify has taken steps to diversify its customer base and reduce its reliance on small businesses, these measures may not protect the company from a recession.

However, there's an excellent long-term rationale to buy

Shopify has easily been one of the most popular stocks in the market since going public in May 2015 at a split-adjusted initial public offering (IPO) price of $1.70. If you had invested at the IPO, you would be sitting on a 34-bagger gain in eight years, while the S&P 500 index returns sit just under a two-bagger! More importantly, there are reasons to believe its market-beating returns will continue.

One of the most compelling reasons many investors continue to push this stock higher is that through the first quarter of 2023, it has maintained robust double-digit revenue growth, even in a weak economic environment that has slowed the overall e-commerce industry. The chart below shows its 25% year-over-year quarterly revenue growth outpaces several of its publicly traded e-commerce infrastructure competitors.

SHOP Revenue (Quarterly YoY Growth) Chart

SHOP Revenue (Quarterly YoY Growth) data by YCharts

Another favorable development for shareholders is that management has shifted away from its previous "growth at all costs" strategy. This strategy worked well when the e-commerce market was booming and resources seemed unlimited. But that philosophy hurt the stock price when the market turned sour, and investors wanted to see profitability. So instead, management's new strategy focuses on efficiency, cost-cutting, profitability, and sustainability.

This shift in approach should result in improved financial performance and benefit shareholders in the long run. The most immediate positive impact should come from selling its logistics arm, eliminating a huge chunk of its capital expenditures, and substantially improving free cash flow. Here is what Shopify CFO Jeff Hoffmeister said during the first-quarter earnings call:

We expect free cash flow, which, as mentioned, we define as operating cash flow less [capital expenditures], to be positive for each quarter of 2023. We, as a management team, are committed to profitability, and you will hear us talking more frequently regarding free cash flow. With the pending sale of our logistics business, obviously, our capital expenditures are going to be a lot lower going forward. We currently expect to spend approximately $100 million for the full year of 2023, which includes two quarters of capex from logistics.

Suppose Shopify can manage its future costs successfully. In that case, it will be in an excellent position to maintain its rapid growth while improving its bottom line, which the market would reward with stock price appreciation. 

Artificial intelligence is the cherry on top

Artificial intelligence (AI) has been all the rage since OpenAI introduced ChatGPT to the market, and when it comes to AI, you should keep Shopify in mind, as it is well positioned to use AI to help merchants.

It has well over 1.7 million merchants on its platform (as of 2020), giving it a wealth of data to train AI models, which it uses to improve the accuracy of AI-powered tools, such as those that help merchants generate product descriptions or prevent fraud. And the sheer number of merchants and consumers that shop on the platform gives it a massive data advantage over almost all its competitors not named Amazon.

It has also recently jumped into the hottest new area, generative AI. In March, Shopify launched a consumer-facing ChatGPT-like shopping assistant, which Shopify President Harley Finkelstein calls "the coolest shopping concierge on the planet." This powerful tool gives customers product recommendations from a pool of hundreds of millions of products and allows them to purchase them directly from the app. 

Shopify uses AI to improve its platform, increase sales, satisfy customers, and lower costs, leading to higher revenue and earnings, potentially boosting its stock price.

Wait for a pullback

Shopify is a stock that you should consider for purchase. However, it's important to note that the current lofty valuation comes with a high level of risk.

If you believe a recession will occur later this year or early next year, you can likely purchase the stock at a more favorable price within 12 months.