For three years, Donald J. Trump has treated the details of his personal and business finances as a closely guarded secret.
On Wednesday, those secrets moved two steps closer to becoming public.
A federal judge in Manhattan ruled against a request from President Trump to block his longtime lender, Deutsche Bank, from complying with congressional subpoenas seeking his detailed financial records. In Albany, New York lawmakers approved a bill that would allow Congress to obtain Mr. Trump’s state tax returns.
Those actions came two days after a federal judge in Washington ruled against Mr. Trump’s bid to quash another congressional subpoena to get his accounting firm to hand over his tax returns and other financial documents.
The court rulings and the New York legislation represent the most serious attempts to pierce the veil that surrounds Mr. Trump’s finances. They increase the odds that congressional Democrats, who have become more vocal in their calls to undertake impeachment proceedings against the president, could enter such a fray with ample ammunition about Mr. Trump’s business dealings.
“Very excited,” House Speaker Nancy Pelosi said after learning of the Manhattan judge’s ruling. “Two in one week!”
Mr. Trump has already appealed the ruling over the subpoena to his accounting firm, Mazars USA, and will almost certainly appeal the ruling handed down on Wednesday. The committees have already agreed to give any appeals a chance to play out before enforcing the subpoenas, but House Democrats are now closer than ever to securing a vast cache of long-sought documents.
Mr. Trump’s finances have been largely a mystery from the moment he declared his candidacy for president. He broke with decades of precedent by refusing to release his federal tax returns. His company, the Trump Organization, is private, and he has disclosed minimal information about how the company makes money and the sources of that income.
Mr. Trump has faced persistent criticism over the interplay between his private business and his public office. The president frequently visits his golf resorts and his private club, Mar-a-Lago in Palm Beach, Fla., and owns a hotel just blocks from the White House that is frequented by foreign dignitaries.
The New York legislation, which is expected to be signed by Gov. Andrew M. Cuomo, a third-term Democrat and regular critic of Mr. Trump’s policies and behavior, would authorize state tax officials to release the president’s state returns to any one of three congressional committees.
The returns — filed in New York, the president’s home state and site of his Trump Tower headquarters in Manhattan — are likely to contain much of the same information as his federal tax returns, which the Trump administration has refused to hand over to Congress.
The Legislature’s actions put the state in a bit of uncharted legal territory; Mr. Trump has said that he is ready to take the fight over his federal tax returns to the Supreme Court, and it seems likely that he would seek to contest New York’s maneuver.
Even so, among the Democrats who have long been frustrated over the president’s refusal to release his returns, the Legislature’s action was cast as a victory for states’ rights and the often-unsung power of their lawmakers.
“It’s a matter of New York’s prerogative,” said Senator Brad Hoylman, the Manhattan Democrat who sponsored the bill in his chamber. “We have a unique responsibility and role in this constitutional standoff.”
In Washington, two congressional committees issued subpoenas last month to Deutsche Bank, the president’s primary lender over the last two decades, and Capital One, where Mr. Trump keeps some of his money. The subpoenas sought decades of personal and corporate financial records, including any documents related to possible suspicious activities detected in Mr. Trump’s personal and business accounts.
Mr. Trump, his company and his three eldest children — Donald Jr., Eric and Ivanka — filed a lawsuit on April 29 to block Deutsche Bank and Capital One from complying with the subpoenas.
Mr. Trump has a long history with Deutsche Bank, the only mainstream financial institution consistently willing to do business with him after a series of defaults left other lenders facing huge losses. Since 1998, the bank has lent him a total of more than $2 billion, and Mr. Trump owed Deutsche Bank more than $300 million at the time he was sworn in as president. The bank is by far his largest creditor, and it possesses a trove of financial records — including portions of his federal tax returns — that it is prepared to provide to congressional investigators.
The president has multiple accounts with Capital One. His relationship with the bank came under scrutiny earlier this year when his former lawyer, Michael Cohen, presented Congress with two checks he had received from Mr. Trump’s Capital One accounts. Mr. Cohen said Mr. Trump wrote him the checks, for $35,000 each, to reimburse him for making a hush-money payment to the adult-film actress Stormy Daniels.
Lawyers for the Trumps argued that the congressional subpoenas were politically motivated and had no legitimate legislative purpose.
Patrick Strawbridge, the lawyer for the Trump family, argued Wednesday that the subpoenas raised “serious questions about the outer reach of power of the Congress,” putting members of the legislative branch in the position of law enforcement officials.
“Congress cannot assume the role of the executive branch,” he said. He also lamented the subpoenas’ reach, noting that they sought records relating to transactions by Mr. Trump’s in-laws and grandchildren.
Douglas Letter, the lawyer for congressional Democrats, said the subpoenas were intended to elicit information on potential money laundering and financial fraud and that they were not overly expansive.
Judge Edgardo Ramos of the United States District Court for the Southern District of New York appeared to agree. “Lots of people do things, they hide assets, they create dummy corporations, they put their relatives in charge,” the judge said in court before he issued his ruling.
Judge Ramos said he agreed with Mr. Trump’s claim that turning over financial records to Congress could cause him and his family irreparable harm. But, he said, the merits of the congressional committees’ goals outweighed that harm.
After issuing his ruling, Judge Ramos said he thought it was unlikely that Mr. Trump and his family would win in a trial.
Mr. Strawbridge told Judge Ramos he would have to talk to the Trump family, but that an appeal was likely. Mr. Trump has already appealed the Washington court’s ruling over the subpoena to Mazars USA.
Under an agreement reached before the hearing on Wednesday, the House Financial Services and Intelligence Committees had agreed to hold off on enforcing the subpoenas until seven days after the judge’s ruling, giving Mr. Trump’s lawyers time to appeal the ruling.
“We remain committed to providing appropriate information to all authorized investigations and will abide by a court order regarding such investigations,” said Kerrie McHugh, a Deutsche Bank spokeswoman.
Capital One representatives did not respond to requests for comment.
The legal setbacks for the president and his family came days after The New York Times reported that Deutsche Bank anti-money-laundering specialists had flagged potentially suspicious transactions involving legal entities controlled by Mr. Trump and his son-in-law and adviser, Jared Kushner. Bank managers overruled those employees and chose not to report the transactions to a federal agency that polices financial crimes.
That report prompted condemnations from Democratic lawmakers, and a number of senators demanded information from Deutsche Bank about its handling of the matter. Treasury Secretary Steven Mnuchin told lawmakers on Wednesday that he has directed the Financial Crimes Enforcement Network, which is part of the Treasury, to assess whether Deutsche Bank is following the rules regarding the filing of “suspicious activity reports” with the government.
Representative Adam Schiff, a California Democrat and chairman of the House Intelligence Committee, said Wednesday that congressional investigators were seeking to interview a former Deutsche Bank employee, Tammy McFadden, who told The Times that she had seen Mr. Kushner’s family company moving money to Russian individuals in the summer of 2016.
Mr. Schiff added that the committee was looking for other Deutsche Bank employees with knowledge of misconduct inside the bank.
“We would want an opportunity to talk to them,” he said.