Although the S&P 500 is up 13% so far this year, many consumer goods and retail companies are struggling under the weight of inflation, and the Federal Reserve said it might raise interest rates even higher to counteract it.

Shopify (SHOP 1.61%) provides business-to-business e-commerce services, but it's impacted by consumer spending at its millions of merchant clients. In the short term, it will likely continue to experience some pressure due to economic headwinds. But its long-term story looks compelling.

Is it a stock to buy now? Let's examine the case.

Bull case: A leading provider in a growing industry

There's been non-linear growth in the e-commerce industry due to acceleration early in the pandemic and deceleration following. Shopify's revenue increased by high double-digit rates during the acceleration period, and it's still strong now -- up 31% year over year in the 2023 second quarter.

It moved $55 billion in gross merchandise sales in the second quarter, making it one of the top e-commerce platforms in the world. Globally, it's the fourth-largest e-commerce business with 10% of the market, but in the U.S., where 55% of its merchants are located, it's in the No. 1 spot, with 28% of the market.

It has millions of merchants, and its growth strategy involves both recruiting new merchant clients and expanding existing client packages.

It has been launching new products and pivoting to attracting larger enterprise clients. Larger clients bring higher revenue than smaller ones, and that could help it scale and get back to net profitability faster. Some of its recent enterprise clients include Unilever and Nestle.

While it offers a full range of services, with packages that include full websites with payment options, it also recently launched a pick-and-choose program where businesses that just need some services, like point-of-sale hardware or checkout services, can get onto the platform. That appeals to many larger companies that don't need the full workup but might be interested in certain solutions.

E-commerce as an industry is expected to keep growing at a rate of around 8% over the next few years, giving Shopify plenty of organic growth opportunities. E-commerce still only accounts for about 19% of total retail sales, giving it plenty of room to run. Shopify should play a big role in the continued e-commerce story.

Bear case: Still getting its act together

Shopify hit net profits briefly when revenue soared in 2020 and 2021, but it began to sag last year when it overestimated continued demand and overshot in its development. It's working on cutting costs and making progress, although it took another hit to expenses with the charges related to selling off the recently acquired fulfillment network Deliveroo.

Its operating loss was $1.6 billion in the second quarter, including an impairment charge of $1.7 billion related to the sale. That implies that without that charge, operating income would have been positive. But management is still working to get to positive income.

Once the business is stabilized with the corrected cost structure, it can begin to grow anew. However, it will likely continue to experience short-term challenges in becoming profitable. Investors also shouldn't overlook the volatile economy and continued potential for a recession or other bumps along the road.

Shopify stock could be huge

Investors were impressed with Shopify's potential for a long time, and Shopify stock soared early in the pandemic. It tanked last year, but Shopify stock is now up 59% this year. Investors see its potential and are cheering its cost-cutting and its decision to sell Deliveroo.  

At this price, Shopify stock trades at 11 times trailing-12-month sales. That's a lot less than its five-year average of 28, but it's still a rich valuation, especially when you factor in slowing growth and losses. 

The long-term story is compelling. Shopify has millions of satisfied customers in a growing industry, and it's managing well through its short-term challenges. However, I would wait for another dip in the price before buying shares.