A grassroots online campaign to fund President Trump’s proposed border wall roared past $8.7 million on Thursday, but questions remained about whether the feds would be able to accept the gift.

As of Thursday evening, 143,821 people had donated $8,742,182 toward Air Force veteran Brian Kolfage’s GoFundMe campaign, titled We the People Will Fund the Wall, just a little over three days after its launch.

The pledge drive aims to raise $1 billion to “uphold our laws, and get this wall BUILT!” Kolfage, a Purple Heart recipient who lost both legs and an arm in Iraq, wrote on the campaign’s web page. “It’s up to Americans to help out and pitch in to get this project rolling.”

Rep. Bob Goodlatte (R-Va.), chair of the House Judiciary Committee and a longtime proponent of tighter border security, hailed the vet’s “impressive” campaign, even as he expressed reservations about allowing private citizens to govern with their wallets.

“I think it’s admirable, and I think that the country should respond,” Goodlatte told The Post. “Obviously, we can’t let citizens raise money and say, ‘The government will spend my money on this purpose.’ ”

According to the Treasury Department, general donations to the feds are directed to a “Gifts to the United States” fund, set aside for “general use” by the federal government or “budget needs.”

Specific federal agencies can’t touch this funding without a congressional appropriation.

Some agencies can accept gifts directly for earmarked purposes, but it was not clear if the Department of Homeland Security, which oversees the borders, was among them.

The DHS did not immediately respond to a request for clarification.

Furthermore, GoFundMe’s terms of service prohibit “not using funds for their stated purpose,” meaning that if the DHS were unable to accept the windfall, Kolfage may have to reimburse his campaign’s donors.