Shares of Amazon (AMZN 1.86%) are already up about 60% year to date, but the stock could still be a buy for your portfolio.

The online retailer and cloud computing giant is starting to reaccelerate growth after things slowed down for the company's operations last year. And after several years of massively ramping up capital expenditures on its fulfillment network and cloud computing infrastructure, 2023 will see a pullback in its spending budget. All that will lead up to a return to strong positive cash flow, which we got a glimpse of in the second quarter.

If you look ahead to the potential cash flow Amazon could generate over the coming year, the shares look inexpensive, even after the run-up in price this year.

Making more use of its massive fulfillment network

Amazon spent heavily to double its fulfillment network footprint from 2019 to 2021, and it's just starting to reap what it's sown.

The rapid expansion and surge in online sales in 2020 and 2021 led to some significant inefficiencies in Amazon's operations. The company has taken steps this year to improve its shipping efficiencies, which should reduce costs while providing faster shipping speeds for customers on more items.

Amazon recently restarted its shipping service for third-party merchants. The service had a brief run before the start of the COVID-19 pandemic. But with the increased strain on Amazon's fulfillment network from the influx of online sales on Amazon.com, it had to suspend the service for non-Amazon sales.

The resumption of service is an indication that it's now making more efficient use of its fulfillment network, and it'll also provide a new growing source of revenue for the company.

What's more, we've normalized from the COVID-related spike and subsequent malaise in e-commerce growth. Amazon's online store sales have seen positive year-over-year growth in each of the last four quarters with that growth accelerating in the most recent three periods.

The secular trend is reversing. Analysts at Wedbush put out a note recently stating that "e-commerce and advertising post-COVID growth rates are bottoming." They expect growth to go back to historical levels in the coming quarters.

That is to say Amazon should see continued improvements in revenue growth this year and next. Analysts expect a slight acceleration in growth from 2023 to 2024, with the top line improving 12% next year to $637 billion.

Amazon's about to start printing cash

With improving revenue and steady capital expenditures, Amazon's poised to start producing significant free cash flow.

The company produced free cash flow of $7.9 billion over the past 12 months. In fact, improvements in free cash flow during the second quarter pushed that trailing-12-month figure into positive territory for the first time since the third quarter of 2021.

Amazon's free cash flow peaked in 2020 when it produced $31 billion. That year saw a notable spike in online sales demand, leading to high utilization of Amazon's fulfillment network. The company is now setting itself up to reach similar levels of utilization but with substantially more sales.

For reference, Amazon's sales totaled $386 billion in 2020. It could be twice that size by 2026.

Not only is Amazon set to improve its fulfillment network utilization, but it's also seen substantial growth in two very profitable businesses since 2020: Amazon Web Services and advertising. Those can throw off substantial free cash flow on top of the online retail operations.

As capital expenditures decline and revenue grows, it shouldn't take long for Amazon to set a new record in free cash flow. If it can reproduce that $31 billion high in 2024, investors are looking at a stock price that's just 44 times its free cash flow. Considering Amazon's historic pricing between 50 and 60 times free cash flow and the strong potential for massive improvements in cash generation beyond next year, the price looks good enough to add more shares to a portfolio.