The economy is facing some serious obstacles. Inflation is chipping away at discretionary income, and a return to normal in the world means people aren't exclusively shopping online anymore. Those are just a couple of the headwinds that could weigh down Shopify's (SHOP -2.37%) business in the near term.

But are investors overreacting? The once-promising e-commerce stock has cratered 74% since the start of the year. Although it's been a bad year for the S&P 500, which has fallen more than 20% already, Shopify has been one of the worst-performing stocks out there as of this writing. So is it now an incredible deal, or is there a genuine reason to avoid it at all costs?

Shopify's growth story isn't over

Although Shopify is facing some challenges heading into a potential recession, the global e-commerce market is still growing. Analysts from Grand View Research project it will be worth more than $27 trillion in 2027 -- nearly three times the $10.4 trillion it was worth in 2020. 

And even if the U.S. market isn't doing all that well, investors need to remember Shopify's platform is used in 175 countries. Many of them are growing at much faster rates than the U.S. and present attractive opportunities for Shopify:

Chart showing e-commerce growth by country.

Investors need to get used to a slower growth rate

Part of the problem for Shopify was that it was simply doing too well amid lockdowns and people staying home due to COVID. Its growth rate during the pandemic took off and reached levels that simply aren't sustainable long term:

SHOP Revenue (Quarterly YoY Growth) Chart

Data by YCharts.

Another problem is that it may simply be too difficult for Shopify to predict its growth rate moving forward. When the company released its year-end 2021 earnings, it only mentioned that sales in 2022 would rise at a slower rate than the 57% it achieved the previous year. It didn't offer a specific projection.

Was the stock's valuation overdue for a correction?

Shopify always traded at a significant premium, and an argument could be made it was due for a price adjustment. Here's how its valuation has compared to other high-priced tech stocks:

SHOP PS Ratio Chart

Data by YCharts.

Going by price to sales (P/S ratio), the stock doesn't look terribly overpriced. The one area where it is definitely lacking is its bottom line. Shopify's operating margin has been just 1% of sales over the trailing 12 months. That makes it incredibly difficult for the company to post a profit and improve on that astronomical price-to-earnings (P/E) multiple. But now with things slowing down, there could be an opportunity to fine tune the business and bring some costs down too. If that happens, Shopify can be a more tenable investment. 

Is Shopify a buy?

Shopify has the potential to be a steal in the long term. But the company has a lot of work to do in improving its margins. If there's progress on that front, it won't be long until the stock recovers. However, with many investors seeking more risk-averse options due to fears of a recession looming, it's certainly possible that Shopify's stock dips further in the weeks and months ahead.

If you're prepared to hang on for years, then Shopify could be a great investment to add to your portfolio today.