But New York City officials have also targeted ride-sharing and meal-delivery apps, as well as facial recognition for building entries — all in an effort to blunt the impact of advancing technology on those who are unable to use it because of financial circumstances, unwilling to for philosophical reasons or vulnerable to its darker aspects.

“Consumers should have the right to choose if they want to pay in cash or not,” said Councilman Ritchie Torres, the bill’s lead sponsor. “We are reining in the excesses of the digital economy.”

Under the bill, businesses that refuse cash face fines of $1,000 for a first violation and $1,500 for each subsequent offense. Businesses with devices that convert cash to cards, like those found in many laundromats, are exempt under certain conditions, including a provision that there be no fee for such cards.

One large New York business that provides cash-conversion machines and would therefore be exempt is the Barclays Center in Brooklyn, where many, though not all, concession stands do not accept cash.

With 23 of Mr. Torres’s colleagues signing on as sponsors, the bill, which he first introduced in 2018, passed the City Council by a 43-3 margin on Thursday. A spokeswoman for Mayor Bill de Blasio said on Wednesday that he supported “the intent” of the legislation, but that his administration still planned to review it.