Shopify (SHOP 1.03%) has grown into a giant in the world of e-commerce software, but in the process, its operations became complex and hard for investors to decipher. However, soon, shareholders will have at least one less business to worry about: logistics.

After shelling out $2.1 billion to acquire shipping solutions provider Deliverr in July 2022, Shopify announced, in conjunction with its Q1 earnings update last week, that it's selling Deliverr and most of its other logistics operations. That hard pivot will rack up some losses, but I don't disagree with the rationale. Shopify's management has realized its finite resources are best used on the software front, not on trying to compete directly with the likes of Amazon in online order fulfillment by constructing warehouses and assembling a fleet of delivery vehicles. 

It's a powerful lesson. Patience is a virtue in investing. Given that it's throwing in the towel less than a year after making its big logistics bet, Shopify certainly doesn't appear to have been patient in this matter. Nevertheless, it's often the case that cutting one's losses and moving on is the best path forward if an investment isn't panning out as expected.

Shopify exits logistics... sort of

Shopify will sell its logistics business, which includes Deliverr, to private start-up Flexport. The selling price? A 13% equity stake in Flexport, in which it already owns a small position. 

Thus, Shopify is exiting the day-to-day operation of logistics, an expensive endeavor involving the construction of warehouses that Shopify expected would cost it billions of dollars to build. This move enables the company to retain its original, asset-light business model. However, its shareholders will still be able to benefit from the logistics industry. If fast-growing Flexport continues to succeed, Shopify's large stake in it could be worth a lot of money in the coming years.

In February 2022, Shopify participated in a funding round for Flexport. It's unknown exactly how much that stake is worth, but at the end of Q1 2023, Shopify listed its investments in "convertible notes in private companies" as being worth $222 million. That's likely the category under which its previous Flexport investment is being reported.

With a little detective work, we can imply the value of Shopify's new stake in Flexport. At the time of Flexport's last funding round in early 2022, it was valued at over $8 billion. Shopify bought Deliverr for $2.1 billion, but will be taking a $1 billion to $1.5 billion write-down on investments next quarter (more on that momentarily). Assuming Deliverr is being written down by $1 billion, that leaves $1.1 billion in value to Flexport, which roughly aligns with 13% that $8 billion valuation Flexport fetched in early 2022. This seems to imply that this bear market hasn't completely clobbered Flexport's fortunes like it has many other private companies. 

Indeed, Flexport even poached Dave Clark -- formerly the CEO of Amazon's Worldwide Consumer business segment -- to be its new CEO in September 2022. Nabbing a high-profile CEO would also seem to imply Flexport is doing just fine. At any rate, we should get some more insight into how stakeholders are valuing Flexport after Shopify reports second-quarter results, since it expects this transaction to close by this summer.

What about all the new expenses incurred?

Admittedly, Shopify will incur some steep losses to offload logistics in exchange for more equity in Flexport. Shopify is also reducing its workforce by 23%, which will include charges of $140 million to $150 million in severance.

Additionally, there will be a $170 million charge related to employee stock-based compensation in conjunction with the sale of the logistics business, and a $1 billion to $1.5 billion impairment charge on Shopify's investments (much of which is likely Deliverr, but we'll have to wait and see). These latter two charges appear to be primarily non-cash expenses, since the $170 million will be paid in newly issued Shopify stock, and the impairment charge is likely related to the $1.7 billion cash component it paid for Deliverr last July (out of the $2.1 billion total price tag). Basically, Shopify is admitting it overpaid for Deliverr.

Given these elevated expenses, why was the market so happy about this sale? Well, the expenses are temporary. Once this shuffle is complete, Shopify will be a leaner machine. In fact, it said it should be free-cash-flow positive for the duration of 2023. (It had $86 million in free cash flow in Q1.) Paired with its outlook for a revenue growth percentage in the mid-teens in Q2 2023, investors had reason to be happy with Shopify's resharpened focus on software.  

While I would have preferred Shopify to not have gone down this logistics path in the first place if it was going to lose its enthusiasm for it so quickly, I like its new plan to profit from logistics growth via Flexport. It's another example of Shopify following its already-established practice of taking investment stakes in key partners, like its sizable investments in "buy now, pay later" business Affirm Holdings and cross-border e-commerce software provider Global-e Online. As of the end of Q1, Shopify said its investment in Affirm was worth $229 million and its Global-e stock was worth $709 million.

Focus on the best, and leave the rest

Shopify's rationale for all of this business rearranging is simple: Now that it's free of the need to build warehouses and a fulfillment network, it can refocus its resources on developing more software for its e-commerce empire. And while its balance sheet took a hit in recent years, it's still solid, with $4.8 billion in cash and short-term investments, $2.3 billion in long-term investments (including Affirm and Global-e), and debt of only $914 million.  

In other words, Shopify cut its losses early and refocused its ample cash on its real bread and butter, which still has plenty of growth potential. Even Amazon knows software is where the real money is now. While consumers may think of Amazon first for its online marketplace and fast delivery, it's the cloud services, software, and digital advertising businesses that pay all the bills

This could be a great lesson for investors, too. Dabble in new ideas, but don't be afraid to cut ties if those experiments don't pan out, and redeploy those funds to double down on your best-performing investments. That's a far better strategy than continuing to pour money into highly speculative ventures with uncertain future payouts.