Starbucks Corp. fans can now trace their coffee. And so can farmers, who will know for the first time where their beans end up.

Starting Tuesday, customers buying coffee at Starbucks stores across the U.S. will be able to use a code on the bags to find out where their beans came from, where they were roasted and even get brewing tips from baristas, said Michelle Burns, the company’s senior vice president of global coffee, tea and cocoa. A reverse code will be given to farmers so that they can finally track their produce.

The new tool, powered by Microsoft Corp., uses blockchain technology and will allow Starbucks to share with its customers the traceability data the world’s largest coffee- shop chain has been collecting for more than a decade. It will also help the company attract sustainably-minded young consumers, many of whom had been flocking to small craft shops where coffee is roasted at the back of the store.

“We have been able to trace every coffee we buy from every farm for almost two decades,” Burns said in an interview ahead of the launch. “That allowed us to have the foundation to now build a user-friendly, consumer-driven tool that certainly provides that trust and confidence to our customers that we know where all of our coffee comes from.”

Millennial consumers have increasingly become more interested in knowing where their food comes from, how it was grown and whether it was produced in a sustainable and ethical way. That’s forcing some of the world’s largest food companies and agricultural commodity traders to be more transparent about their supply chains. And for that, they are turning to technology.

Blockchain Initiative

Last year, some coffee roasters including J.M. Smucker Co. and Jacobs Douwe Egberts joined a blockchain initiative, developed in partnership with International Business Machines Corp. Farmer Connect, a startup backed by Swiss coffee trader Sucafina SA, is helping the firms trace the origin of the beans they buy and sell as well as pricing along the supply chain.

Tracing coffee back to the farmer level has its own challenges. Beans from various farms can get mixed up along the supply chain. For Starbucks, that means some bags, such as the ones that contain blends, will be tracked down to country level. Others will be traced down to the region where the beans were grown, the community that delivered into a certain washing station, or even down to the farmer himself, in the case of single-origin packages.

“We go as deep as we can,” she said, adding Starbucks is able to trace even the beans it buys from traders as they require receipts for every transaction.

Farmers will also get access to the tool. And they don’t need a smart phone or a camera for that. The traceability website can be accessed from any laptop or desktop and the code can also be inserted manually. That will allow growers to understand where their beans end up, whether they own a sophisticated farm in top producer Brazil or they are smallholders in African nations like Ethiopia or Rwanda.

“What they told us is they didn’t know where their coffee went, what blend it went to,” Burns said.

The tool isn’t yet available for Starbucks bags purchased outside licensed stores, or on a per-cup level. When asked if the coffee-chain operator had any plans to expand that, Burns said: “We are just getting started.”