The men's lawyer and Mayor Jim Kenney outlined the agreement to The Associated Press.
The arrest of Rashon Nelson and Donte Robinson on April 12 touched off a furor around the U.S. over racial profiling.
They were led away in handcuffs after the manager called police, saying the men refused to buy anything or leave. After spending hours in jail, they were released and no charges were filed.
The men said they were waiting for a business meeting about a potential real estate deal.
Starbucks CEO Kevin Johnson came to Philadelphia to personally apologize. He also announced Starbucks stores would close May 29 for training on bias.