Wakefield Council has lost its appeal against a High Court judgement last year, which said they were overcharging local drivers who applied for a licence to trade.
That £384 fee included cash to help cover the costs of policing the industry and punishing drivers who broke the rules.
But three of the UK's top judges have ruled that that approach, which has been adopted by many local authorities, is unlawful.
Solicitors for Wakefield Council had argued that the policy was necessary to make its licensing department run self-sufficiently. Although the Court of Appeal said councils can still recover the costs of enforcement action from the taxi trade, rather than the taxpayer, they will now have to do so differently.
Drivers claimed that the council is now facing a bill of more than £1m in repayments for cases dating back to 2004. The local authority disputes that figure, and says drivers were only overcharged over the course of last year.
The council has also hit out at the High Court, claiming it failed to clarify what they were allowed to do at the original hearing 12 months ago.
The Wakefield District Hackney Carriage and Private Hire Association, which brought the original case before the courts last year, welcomed the ruling.
Chairman Abdul Rehman said: "We are of course very pleased that the Court of Appeal agreed with us and the High Court.
"We hope now the law has been clarified, the council will agree to meet with us to discuss how the council can refund the monies it has overcharged vehicle
owners to avoid further court action."
Glynn Humphries, the council's service director for the environment, said: “The legal position as to where enforcement costs could be attributed was unclear and (Wednesday's) judgement has clarified that the costs of enforcement should be met by the taxi trade through fees and should not be subsidised by the council tax payer.
“We very much welcome the clarity from (Wednesday's) judgement but are disappointed we didn’t get this in the High Court last year, which would have saved everyone involved time and money.
"The council will now review our position in light of the judgement and set up a process to enable drivers to log any claims as easily as possible and try and ensure we assess the claims as quickly as we can.
"We strongly believe that the £1million figure quoted by the taxi trade association does not apply to Wakefield at all.
"The fees were only applied to vehicles in January 2018 and charges were paused as we sought clarity from the court, which means that no drivers have been charged for this activity from December 2018.
"Going forward we will ensure that all charges are set against the criteria confirmed by the court."
The Local Government Association (LGA), which had been supporting Wakefield Council over the case, declined to comment.
Local Democracy Reporting Service