Mail-order drug company PillPack prepackages consumers' pills for daily or hourly use. Pat Greenhouse | The Boston Globe | Getty Images

Online pharmacy start-up PillPack is in talks to be acquired by Walmart for under $1 billion, according to two sources familiar with the matter. PillPack's focus on making it easier for customers to order and fulfill medications is an attractive proposition for Walmart and other e-commerce companies that are looking to enhance their health care offerings. The talks come amid reports of early acquisition talks between Walmart and health insurance giant Humana, which would be a much larger deal. The sources cautioned that the PillPack deal is not yet finalized and could still fall apart, and that Walmart has considered buying a number of start-ups. Still, the sources said discussions between the two about a sale have been happening for months.

A Walmart spokesperson told CNBC, "We are often asked to speculate on possible acquisitions and we simply don't comment on those types of questions." Amazon also courted the company and at one point held discussions, two of the people said. Amazon is working with Berkshire Hathaway and J.P. Morgan to bring down health costs for its own employees. It is also building a team internally to explore opportunities to disrupt the drug supply chain, which represents a $3 trillion market. PillPack declined comment. Amazon could not be immediately reached for comment.

'A huge differentiator'