Shoppers look at shoes at a Macy's department store in New York.

Macy's said Wednesday it's dipping its toes into both the clothing subscription and apparel resale businesses.

The department store operator said it started a pilot this month with resale marketplace ThredUp at 40 Macy's stores across the country, taking up about 500 square feet of space at each location.

"We know many consumers are passionate about sustainable fashion and shopping resale," CEO Jeff Gennette said on a call with analysts. "This partnership gives us the opportunity to reach a new customer and keep them coming back to shop an ever-changing selection of styles, and brands, that we don't typically carry."

Earlier, Macy's reported fiscal second-quarter earnings that fell well short of estimates and cut its forecast for the year. Shares fell more than 13%. Macy's results were hurt as it was forced to mark down merchandise during the spring to clear inventories.

Gennette told analysts that millennial and Gen Z shoppers especially are looking for rental and resale options. He said this strategy is also a way for Macy's to acquire new customers.

As Macy's puts merchandise from ThredUp into its stores, it will be taking items from brands and categories that Macy's doesn't currently offer, Gennette explained, telling analysts this won't result in any cannibalization of Macy's existing offering.

Meanwhile, at its Bloomingdale's business, Macy's is working with CaaStle, a start-up that assists retailers in rolling out subscription clothing services.

Gennette said: "Learning from Bloomingdale's will inform the development of a similar rental service at Macy's in the near future. ... We need to play in this game."

Macy's certainly won't be the first retail to try this, either.

Companies including Express, American Eagle, Ann Taylor and Urban Outfitters have launched subscription or rental services for their clothes. The companies are all trying to build on the success of platforms like Stitch Fix and Rent the Runway, which offer clothes either through personalized boxes, or on a rent-to-own basis. Luxury consignment platform The Real Real is also growing; when it reported earnings on Tuesday evening it said revenue jumped 51% from a year ago to $71 million.

And Nike earlier this week launched its first subscription box, for kids sneakers.