The UK Independence Party is waiting to find out whether it must forfeit £367,697 in "impermissible" donations.
The UK Independence Party must forfeit £18,481 in "impermissible" donations, a court has ruled.
The Electoral Commission says it broke the law by accepting money from former bookmaker Alan Bown, whose name was not on the electoral register.
The party had feared it would face financial ruin after the Electoral Commission said it should be forced to pay out as much as £367,697.
But UKIP, which has 10 MEPs, said this was caused by a clerical error.
But it was told it only had to hand over £14,481 in donations made by retired bookmaker Alan Bown at a time when he was not on the electoral roll.
Westminster magistrates are to decide whether the party must forfeit the money, which would go into central government funds.
UKIP also had to forfeit £4,000 from Isle of Man-registered firm Nitech.
Party leader Nigel Farage has warned that a verdict against UKIP could leave it "penniless".
Mr Bown has donated more than £1m to UKIP in recent years.
The 2000 Political Parties, Elections and Referendums Act forbids taking money from certain "impermissible donors," normally people or organisations not registered in the UK.
Parties have up to 30 days from the date the donation was received to return the money to the donor.
UKIP was formed in 1993 to campaign for Britain's exit from the European Union.
Since taking over as leader last year, Mr Farage has attempted to broaden its appeal to attract Conservatives disaffected with David Cameron's leadership.