Amazon (AMZN -1.59%) is scheduled to report fiscal 2022 second-quarter earnings after the markets close on Thursday, July 28. The e-commerce giant is grappling with evolving consumer behavior as the economic reopening gains momentum worldwide.

The company could barely keep up with customer demand at the pandemic's onset, so it invested aggressively in expanding its shipping and fulfillment capacity. Then, when the additions were up and running, customer orders started to cool off. Now Amazon has more capacity than it needs or wants, costing the company billions quarterly. That's partly why I'll be watching closely when it releases second-quarter figures on July 28. 

Amazon overinvested in fulfillment capacity

In its most recently reported quarter, which ended on March 31, Amazon's online sales decreased by 3% compared to the same period the year before. That was partly due to a difficult comparison with Q1 2021, when sales jumped 41% year over year. Recall that this time last year, consumers were more concerned about leaving their homes to shop at brick-and-mortar stores. Vaccinations against COVID-19 accelerated throughout 2021 into 2022, giving folks more confidence in public places.

The quick turnaround in customer behavior weighed on Amazon's profitability after it invested billions in expanding its capacity. In the quarter ended in March, Amazon's operating income fell to $3.7 billion from $8.9 billion in the year-ago period. Management noted a long lag between when its capital investment decisions are made and when the projects are completed. When the company decided to expand its capacity, sales were booming, and it could hardly keep up with the orders.

To make matters worse, rising fuel, labor, and materials costs are further biting into Amazon's profits. Inflationary pressure was estimated to impact the company's expenses by $2 billion in the quarter ended in March. The lower productivity that resulted from being overstaffed cost Amazon another $2 billion. Finally, the overcapacity in fulfillment centers was another $2 billion expense the company did not need in Q1. Overall, Amazon had $6 billion in costs above what was required to fulfill customer demand.

It will take time for the e-commerce specialist to work through the excesses, partly via employee attrition and partly through sales growth. Meanwhile, operating income could be pressured for several quarters. Management's forecast for Q2 operating income is $1 billion at the midpoint, which would be down from the $7.7 billion it reported in the same period the prior year.

Sales growth is critical for Amazon

Analysts on Wall Street expect Amazon to report revenue of $119.43 billion and earnings per share (EPS) of $0.16. If the company meets these projections, they will represent an increase of 3.7% and a decrease of 78.95%, respectively, from the same period a year prior.

Interestingly, the revenue forecast from analysts is 130 basis points below the midpoint of management's forecast for 5% growth in Q2. Consumer shopping is shifting toward away-from-home experiences like travel, restaurants, and concerts, which could divert sales from Amazon. Given the persistence of its expenses, sales growth will be crucial for the company over the next several quarters, so stay tuned. The stock is already 37% off its highs due to the cost headwinds.