—In an action for a judgment, inter alia, declaring unconstitutional certain resolutions passed by the Town of Wallkill Town Board on January 12, 1989, fixing water and sewer tap-in fees, the Town of Wallkill appeals from (1) an order of the Supreme Court, Orange County (Miller, J.), dated June 6, 1992, which declared the resolutions void, and (2) a judgment of the same court, entered June 30, 1992, which, inter alia, awarded the plaintiffs the recovery of sums paid to the Town pursuant to the resolutions.
Ordered that the appeal from the order is dismissed; and it is further,
Ordered that the judgment is affirmed; and it is further,
Ordered that the respondents are awarded one bill of costs.
The appeal from the intermediate order must be dismissed because the right of direct appeal therefrom terminated upon the entry of judgment in an action (see, Matter of Aho, 39 NY2d 241, 248). The issues raised on appeal from the order are brought up for review and have been considered on the appeal from the judgment (see, CPLR 5501 [a] [1]).
On January 12, 1989, the Town of Wallkill adopted Resolutions 1 and 2 which respectively imposed a $2,000 tap-in fee per eight fixture units connected to the Town water system and a $2,500 tap-in fee per eight fixture units connected to the Town’s sewer system. Sums collected pursuant thereto were to be placed in a Capital Improvement Fund for upgrading the Town water and sewer systems, which had to be replaced pursuant to State and Federal direction.
We agree with the Supreme Court’s declaration that these resolutions were void as unconstitutional. The Town’s authority to impose a sewer connection fee is statutorily limited to the construction expense of providing service, a fee for the inspection of the connection, and the expenses of performing any service or providing any special benefit to the user (see, Town Law § 198 [1] [h]). The Town’s authority to impose tap-in fees on its water facilities is likewise limited to the costs of installation of the supply pipe (see, Town Law § 198 [3] [a]). Here, the Town exceeded its permissible powers by exacting tap-in fees in order to offset the cost of capital improvements (see, NY Const, art IX, § 2; Coconato v Town of Esopus, 152 AD2d 39, 42; Matter of Torsoe Bros. Constr. Corp. v Board of Trustees, 49 AD2d 461, 465).
The remaining issue for our consideration is whether the *556plaintiff Video Aid Corp. (hereinafter Video Aid) was entitled to reimbursement of the $27,000 it had paid without protest pursuant to the stricken resolutions. We hold that it was so entitled.
On December 11, 1991, the plaintiffs applied to the Town of Wallkill for a building permit to construct the interior of the unfinished portion of the building they occupied. Along with their application they included a check for $11,000 as payment for the building permit fee. Thereafter, they were advised that without the additional payment of water and sewer hook-up fees pursuant to Resolutions 1 and 2, no building permit would be issued. The building in question had been occupied since 1986 and was already fully serviced and connected to water and sewer lines. All that was required was to extend the lines inside the building at the plaintiffs’ sole cost and expense in order to install the necessary plumbing fixtures. Thus, it appeared that there was no construction expense to be incurred by the Town. Despite these factors, the Town exacted a $27,000 tap-in fee from Video Aid, which was paid without protest on or about January 10, 1992. Shortly thereafter, on or about February 13, 1992, the plaintiffs commenced this action seeking to have the resolutions in question voided and seeking reimbursement of the fees paid.
Generally, the voluntary payment of a tax or fee may not be recovered (City of Rochester v Chiarella, 58 NY2d 316, 323, cert denied 464 US 828; Mercury Mach. Importing Corp. v City of New York, 3 NY2d 418, 424-425; Adrico Realty Corp. v City of New York, 250 NY 29). Thus, when a payment is made under a mistake of law, with actual or constructive knowledge of the facts, as here, it is incumbent upon the taxpayer to demonstrate that payment was made involuntarily. Payment of a tax under appropriate protest will ordinarily suffice to indicate the involuntary nature of the payment (City of Rochester v Chiarella, supra, at 323; Mercury Mach. Importing Corp. v City of New York, supra, at 425). The failure to register formal protest, however, will be excused in cases in which the payment is made under duress or coercion. The duress necessary to indicate involuntariness is present in circumstances where payment of a tax is necessary to avoid threatened interference with present liberty of person or immediate possession of property (City of Rochester v Chiarella, supra, at 323; Mercury Mach. Importing Corp. v City of New York, supra, at 425; Five Boro Elec. Contrs. Assn. v City of New York, 12 NY2d 146, 150).
It is generally recognized that although the test of involun*557tariness is easily stated, it is not quite as easy to apply (City of Rochester v Chiarella, supra, at 323; Paramount Film Distrib. Corp. v State of New York, 30 NY2d 415, 420, remittitur amended 31 NY2d 678, cert denied 414 US 829). The difference between voluntary and involuntary is often one of degree and turns on many factors including the right of taxing authorities to rely on objection if there be resistance to payment, the likelihood that authentic resistance will be asserted, the unavoidable drastic impact of the taxes or fees on the claimant, and the impact on the public fisc, if revenues raised long ago and expended are subject to reimbursement (see, Paramount Film Distrib. Corp. v State of New York, supra, at 420).
We are persuaded that Video Aid is entitled to reimbursement of the tap-in fees because such fees were paid involuntarily. Here, there was a direct threat to the plaintiffs’ property rights in that they could not obtain a building permit for scheduled work unless they paid the tap-in fees in addition to the building permit fee. Thus, payment of the tap-in fees was necessary to avoid the Town’s threatened interference with immediate possession of property (see, Buckley v Mayor, 39 App Div 463, affd 159 NY 558). This situation is contrasted with those in which a Town has taken no steps to enforce payments pursuant to a later-invalidated law or regulation, yet the plaintiffs have, in any event and without protest, paid the subject tax or fee (cf., Rochester v Chiarella, 58 NY2d 316, cert denied 464 US 828, supra; Mercury Mach. Importing Corp. v City of New York, 3 NY2d 418, supra).
We are further pursuaded by the fact that the plaintiffs commenced this action shortly after the tap-in fees were paid, thus quickly alerting the Town to their disagreement with the fees. In this sense, the instant case does not concern fees paid long ago and likely expended, creating the likely potential for a drastic impact on the public fisc (cf., Paramount Film Distrib. Corp. v State of New York, supra; Mercury Mach. Importing Corp. v City of New York, supra; but see, Five Boro Elec. Contrs. Assn. v City of New York, supra).
Additionally, we have considered the fact that the Town would be unjustly enriched if entitled to retain the tap-in fees paid by Video Aid. Such fees rendered a direct benefit to the Town (cf., Paramount Film Distrib. Corp. v State of New York, supra) and far outstripped any nominal cost incurred by the Town in granting Video Aid a permit. The fees were extracted to raise revenue to pay for the Town’s new sewer and water systems, while Video Aid incurred the entire cost and expense of tapping into the existing sewer and water lines.
*558The Town’s remaining contention is without merit. Miller, J. P., Lawrence, Altman and Krausman, JJ., concur.