Uncovering and explaining how our digital world is changing — and changing us.

Target held serious acquisition discussions over the last few months with the mattress startup Casper Sleep, according to multiple sources, but plans to take a minority stake instead.

Multiple sources told Recode that Target offered $1 billion to buy the fast-growing New York City-based company, but the two sides couldn’t work out a deal.

Casper had been out raising a large round of funding when the talks started, sources said. The startup generated around $200 million in sales in 2016 — its second full year in business — and was valued at around $550 million after its last private investment in 2015.

Instead of acquiring Casper, Target will likely be the lead investor in a large new round of funding for the startup that could be announced in the coming weeks.

Spokespeople for Target and Casper declined to comment.

The deal talks come as Target — like many large brick-and-mortar retailers — is struggling to stanch declining store traffic and decreasing sales as young shoppers opt for new, digital-native brands and Amazon continues to eat up market share across the board.

Target’s leadership also could be feeling the pressure to make a big splash, following the acquisition spree that Walmart is on. Walmart saw digital revenue increase 63 percent in the first quarter of the year — more than four times the industry average.

In February, Target outlined a plan to rejuvenate its sales by introducing more than a dozen exclusive brands over the next two years, in categories like apparel and home. The company has already found success over the last year with new kids brands Cat & Jack and Pillowfort.

Over the last two years, Target has also partnered with digital-first brands like Bevel and Harry’s in grooming, and Who What Wear in clothing, in an effort to lure young shoppers into its stores.

Last week, it announced that it would start selling Casper mattresses and bedding through its website, as well as in 35 of its stores located near college campuses. Casper will be the only mattress brand available for sale on Target.com when the partnership launches in late June.

Casper, founded in 2013, launched publicly in the summer of 2014. It has grown rapidly since then on the back of aggressive marketing coupled with a cult following among millennial customers in urban centers.

The company was among the first so-called bed-in-a-box companies that sell foam mattresses, folded up in a box, that they ship to customer doors. Casper offers a 100-day return policy that has helped some shoppers get comfortable with ordering a mattress online without trying it out first.

The company, led by mattress industry entrepreneur Philip Krim, faces stiff competition from a host of young competitors like Tuft & Needle, Leesa, Purple Mattress and GhostBed, but has built a brand it believes can extend into more products around the home.

Together, these companies are also attempting to steal market share from traditional mattress companies that haven’t faced this much disruption in a long time.

Casper also sells bedding, pillows and a version of a box spring. It will start selling a new “lounger” chair exclusively through Target, Target said last week.

In addition to its own website, Casper also sells products on Amazon.com, WestElm.com and in dozens of West Elm stores.

Sign up for the newsletter Recode Daily Email (required) By signing up, you agree to our Privacy Notice and European users agree to the data transfer policy. Subscribe