Amazon isn’t just a master at selling stuff. It’s also a shrewd buyer — as its $13.7 billion agreement this morning to acquire Whole Foods demonstrates.

Usually, in a big deal like this one, investors respond to the news by driving down the acquirer’s shares. But Amazon ended the day up 3%.

Buyers are optimistic that CEO Jeff Bezos will boost Amazon’s revenues and reach by establishing a foothold in the nearly $1 trillion a year U.S. grocery business. That could be reason enough to justify the acquisition.

But the deal also raises intriguing possibilities for Amazon to expand scale, and deepen customer loyalty, for its entire sales ecosystem — including its media offerings led by the Amazon Prime streaming video service.

The company should find it easy to dream up deals that motivate Whole Foods customers to sign up for Amazon Prime — the $99 a year service that includes streaming video and music, as well as two-day delivery of most products Amazon sells.

The e-retailer might also tempt Prime members to pick up an Amazon Echo. The voice driven device answers questions, executes orders to fulfill digital demands including queuing up videos and play lists, and of course makes it easy for users to buy products from Amazon.

That could now include Whole Foods shopping lists. (Would it confuse Echo if Bezos was playful enough to offer meat eaters a cut called Amazon Prime?)

And, of course, the additional data about customers’ grocery likes would strengthen Amazon’s ability to charge high prices for targeted ads. Buyers could know, from people’s shopping histories, who might be a promising prospect to buy, say, a particular kind of cereal or dog food — and craft sales pitches based on that intimate knowledge.

What may be more important for Bezos, though, are the delivery options open to him with 450 Whole Foods stores spread across 48 states. They will give Amazon outlets across the nation’s upscale neighborhoods.

Assuming the company doesn’t limit Whole Food stores — and the distribution network that serves them — to groceries, then they can help address a nagging problem: speed. Bezos has long dreamed about adding same day delivery to a system that consumers find easy to use.

Analysts are betting that Amazon will make the deal pay off.

BMO Capital Markets’ Daniel Salmon says he’s “highly confident that Amazon will leverage the new store footprint for much more than just selling groceries.”

Cowen & Co’s John Blackledge says that grocery is Amazon’s “biggest potential source of revenue upside over time” and represents “the continued evolution of Amazon’s multi-platform approach.”

RBC Capital Markets’ Mark Mahaney warns that Amazon faces “substantial execution risk” in the deal. But he isn’t worried: For a company of Amazon’s size “this is actually a relatively modest acquisition.” As a result, it’s not “an investment thesis changer” for Amazon although “the competitive implications for other grocers could be enormous.”