The S&P 500 returned an average of 285% during the last five bull markets, and the next one is drawing closer. The index is just five percentage points away from a record high, the most conservative signifier of a new bull market.

Investors hoping to benefit should be buying stocks today, and Shopify (SHOP 1.11%) is worth consideration. The e-commerce software company saw its share price rise 375% over the last five years, and the next bull market could send the stock much higher.

Shopify has a strong presence in retail e-commerce

Research company Gartner recently ranked Shopify as a leader in digital commerce software, citing a greater ability to execute than any other vendor. Indeed, the company has become a cornerstone of the retail industry. Shopify merchants accounted for more than 10% of online retail sales in the U.S. last year, making it the second-largest domestic e-commerce company behind Amazon.

That prolific market presence is a result of its robust product offering. Shopify provides software that enables merchants to manage their businesses across physical and digital sales channels, and it offers adjacent services that address everything from payments and logistics to expense management and taxes. Its platform also features thousands of third-party integrations that further extend its functionality.

Shopify reported impressive financial results in the third quarter. Revenue rose 25% to $1.7 billion, driven by strong sales growth in subscription software and adjacent merchant services. Shopify also returned to generally accepted accounting principles (GAAP) profitability. Its net income improved to $718 million, up from a loss of $159 million in the prior year. Investors have good reason to expect similar momentum in the future.

Looking ahead, retail e-commerce sales are expected to increase by 8% annually to reach $8 trillion by 2030. Shopify will undoubtedly benefit from that tailwind. However, the company also has major growth prospects in wholesale e-commerce, as well as untapped monetization opportunities with artificial intelligence (AI) products that investors may be overlooking.

Shopify has a major growth opportunity in wholesale e-commerce

Shopify Plus is a commerce platform for larger enterprises. It is the most popular omnichannel commerce software product on the market, according to research company G2. Plus merchants get access to exclusive tools and features, including more detailed organizational settings, customizable checkout options, and sophisticated applications for data analytics, marketing, workflow automation, and business-to-business (B2B) e-commerce.

The recent addition of B2B capabilities is particularly noteworthy because it unifies wholesale and retail functionality on a common platform. That makes Shopify a more compelling option to businesses of all sizes, but it should be particularly useful in onboarding more enterprise-scale merchants.

Additionally, B2B capabilities allow Shopify to tap a market roughly four times larger than retail e-commerce. Straits Research expects wholesale e-commerce sales to increase by 19% annually to reach $36 trillion by 2031.

Shopify has untapped growth opportunities in artificial intelligence

Shopify introduced marketing software for Shopify Plus merchants in May 2022. The product, called Shopify Audiences, uses machine learning algorithms powered by shopper data collected across the platform to compile lists of potential customers.

Those lists can be exported and used to target advertising campaigns across various platforms, including Google Search and YouTube by Alphabet, Facebook and Instagram by Meta Platforms, Snapchat by Snap, and TikTok. Shopify Audiences is currently free, but the company will almost certainly monetize the product at some point in the future.

The same logic applies to Shopify Magic, a suite of free AI features recently made available across the Shopify platform. Magic uses a natural language interface to let merchants automate a range of commerce workflows, everything from redesigning storefronts and creating discounts to writing product descriptions and running sales reports.

When (and if) Shopify decides to monetize its AI software products, the company will be tapping into a market forecast to grow at 23% annually to approach $1.1 trillion by 2032.

Shopify stock trades at a cheap valuation by historical standards

Shopify should benefit from the growing prevalence of retail e-commerce, but the company also has growth prospects in wholesale e-commerce and untapped monetization opportunities with its AI products.

With that in mind, Morningstar analyst Dan Romanoff believes Shopify could grow revenue at 23% annually over the next five years. That forecast makes its current valuation of 14.2 times sales look reasonable, especially when the three-year average is 25 times sales. That's why investors should buy a few shares of this monster growth stock today.