This proceeding is not an action upon the special contract, but of quasi-contract, to recover the benefits, if any, which the plaintiff may have conferred upon the defendant by his part performance of the special contract.
A quasi-contract exists independently of the intention of the parties, and is founded upon the doctrine of unjust enrichment. Its origin may be in the partial performance of a contract (Britton v. Turner, 6 N.H. 481); and the benefit conferred upon the *Page 223 defendant by the part performance, and not the detriment incurred by the plaintiff, is the basis of liability. Britton v. Turner, supra; Davis v. Barrington, 30 N.H. 517; Allen v. Jarvis, 20 Conn. 38; Wellston Coal Co. v. Company, 57 Ohio St. 182; Keener Quasi-Cont. 253; 9 Cyc. 689. If there is a liability to pay for a partial performance where it has not been beneficial to the defendant, it does not exist because of any promise which the law would imply, but rests solely on the special contract between the parties. Allen v. Jarvis, supra; Southern Pacific Co. v. Well Works, 172 Ill. 9; 9 Cyc. 688; and authorities above cited.
The right of one who has partly performed a contract to recover in quasi-contract is stated by Woods, C. J., in Davis v. Barrington, supra, 527, as follows: "It would seem to be the doctrine in this state, . . . that where labor is done and materials found by a person for another upon a special contract, and the contract is not performed according to its terms, that when the services are of a character, and the materials found are furnished under such circumstances, that the same can be rejected, . . . and the obligee can avoid receiving any benefit therefrom, and does not in fact assent expressly or by implication, . . . but refuses to accept the same, the party so performing the labor and furnishing the materials will not be entitled to recover, . . . for the reason that the contract is not performed, and . . . the person for whom the services were rendered and the materials furnished has not in fact been benefited thereby, but has . . . refused to accept the same . . . But there is a class of cases in which the services . . . are from their very nature accepted from day to day, as the labor progresses, and where the benefit or the labor must necessarily be regarded as accepted and the benefits thereof appropriated by the employer, who, notwithstanding he will not be liable upon the special contract, . . . will nevertheless be liable to pay the fair price and value of the benefits resulting from the partial performance of the contract, over and above the amount of damage sustained by the breach."
In the latter class of cases, the underlying principle seems to be that, although the contract calls for a continued service, the parties have agreed in advance to an apportionment of the contract and an acceptance of the service as it shall be rendered from day to day, and that the performance of the whole labor is not to be treated as a condition precedent to the employer's obligation to pay, unless the parties expressly stipulate that it shall be, by providing that nothing shall be earned until the whole service is performed (Britton v. Turner, supra, 493); while in the former class, the reasonable construction of the contract is that it is entire, is not apportionable, and the agreement to fully perform is a condition *Page 224 precedent to the employer's obligation to pay, without an express stipulation to that effect.
The contract in question did not contain an express provision that the completion of the heating plant should be a condition precedent to payment, although it called for a completed structure. The question therefore arises to which of the above classes of cases it belongs. It does not seem to us that the work of installing the heating plant was from its very nature incapable of being rejected, and must be understood to have been accepted from day to day as the work progressed. The opposite construction is more reasonable. The case does not find that it would have been impossible, or even impracticable, to remove the boiler, radiators, and piping, but does find that their value amounted to $466.38, while the labor of installing them amounted to but $46.80. This would indicate that the expense of removing them would not have been unreasonable. They were destroyed by fire before the completion of the work, without the fault of either party, without the defendant having made any use of them, and, as it would seem, before he was called upon to accept or reject them. The only reason that can be advanced for construing the contract to mean that the defendant agreed in advance to accept the labor and materials from day to day, is that by adopting this construction the conclusion could be reached that the defendant was benefited. But the facts presented do not warrant the construction.
Unless the plaintiff procures an amendment showing that the removal of the boiler, radiators, and piping, before they were destroyed by fire, was not reasonably possible, or stating other facts which would establish that the parties must have understood that the plaintiff's performance of the contract was accepted from day to day as the work progressed, there should be judgment for the defendant.
Case discharged.
PARSONS, C. J., and WALKER, J., concurred.