(Bloomberg) -- Shopify Inc. is cutting jobs for the second time in 10 months and selling the majority of its logistics business to Flexport Inc. to focus on its core e-commerce platform business. 

The moves mean the company will shrink by more than 2,000 people. “I don’t want to bury the lede: after today Shopify will be smaller by about 20% and Flexport will buy Shopify Logistics; this means some of you will leave Shopify today,” Chief Executive Officer Tobi Lütke said in a memo to staff. “I recognize the crushing impact this decision has on some of you, and did not make this decision lightly.”

Shopify soared about 27% to C$79.76 as of 10:35 a.m. in Toronto, the biggest intraday rise since 2015. 

The company expects to incur severance charges of $140 million to $150 million. “Our numbers were unhealthy, just like it is in much of the tech industry,” Lütke said. “With the right numbers we’ll fully focus on outcomes and impact.” During a conference call, executives said Shopify has to operate with greater speed and is moving quickly toward its ideal size.

The logistics deal is a big change for the Canadian e-commerce giant, reversing a strategy it had implemented to better compete with Amazon.com Inc. Flexport will acquire most of its fulfillment assets including those of shipping startup Deliverr Inc., which Shopify bought just last year for $2.1 billion. 

“We applaud management for making difficult decisions that set the company up better for long-term success, although this is significant pivot,” Baird analyst Colin Sebastian wrote in a note to clients.

Revenue for the period came in at $1.51 billion, beating the $1.43 billion average estimate of analysts surveyed by Bloomberg. Gross merchandise volume, the total value of merchant sales across Shopify’s platforms, was $49.6 billion, above Wall Street projections of $47.7 billion.

Bloomberg Intelligence analyst Anurag Rana:

“Shopify divesting its logistics business is a good strategic move, especially as Amazon.com pushes its ‘Buy with Prime’ program for non-Amazon sellers. This strategy shift, while painful in the short-term due to write-downs and layoffs, will increase the company’s focus on selling more products through its platform. Separately, 1Q results were surprisingly strong with sales 640 bps higher than consensus.”

The Ottawa-based company also gave an outlook for the second quarter, saying it expects revenue to grow at a similar rate to the first quarter growth rate on a year-over-year basis. It also expects to achieve free cash flow profitability for each quarter of 2023.

Shopify bet early in the pandemic that a rapid rise in online shopping, fueled by customers staying home, would become permanent. As that wager soured, Lütke has been forced to retrench. The company cut about 1,000 jobs last summer, raised prices and focused on building out client offerings and its in-house fulfillment network. Shopify had 11,600 employees at the end of 2022.

The company has had to contend with macroeconomic risks, including slower consumer spending and inflationary pressures. Retail sales fell 1.4% in March, according to a preliminary Statistics Canada estimate.

(Updates with more details throughout, analyst comment, share price)

©2023 Bloomberg L.P.