This was a suit, in two counts against a contractor, to recover a sum of money alleged to be due the plaintiff on a written order to it, signed by the defendant as the agent of the owner of a building to be erected by the defendant, for certain material to be furnished and made a part of the building by the plaintiff. The petition alleged that the plaintiff complied with all the provisions of the order, furnished and installed the material, and that the building was completed and turned over to the owner, who paid the defendant what was due it under a written contract signed by the defendant and the owner. A copy of this contract was attached to the petition, and it appears therefrom that the defend*409ant, in erecting the building, was acting as the agent of the owner. The petition further alleged that a certain sum of money was still due the plaintiff under the provisions of the two contracts, and that this sum the defendant refused to pay. The order for the material, signed by the defendant, contained the following provision: “Liability: This order is a direct obligation upon Mr. H. J. Dynes [the owner].” The first count of the petition was based upon the theory that the defendant was an independent contractor and was directly liable to the plaintiff for the amount alleged to be due under the two contracts. The second count of the petition was brought against the defendant as the agent of the owner of the building, alleging that under the two contracts the defendant in buying the material and labor from the plaintiff was acting as the agent of the owner. This count further set out that, during the erection of the building, upon orders from the defendant and the architects in charge of the building, the plaintiff was called upon to furnish additional material and labor to that called for in the original order-contract, which he did at an additional expense to him. An itemized statement showing the additional material and labor furnished and the cost of the same was attached as an exhibit to the count. It was alleged in the count that upon the completion of the building the owner paid to the defendant a certain sum of money for the purpose of being paid to the plaintiff and other materialmen for the material and labor used in the construction of the building, and that the defendant, in receiving the money, was acting as the agent of the plaintiff and other materialmen. The count alleged further that under the contracts and the order for additional material and labor, the plaintiff was due a certain sum of money which the defendant refused to pay.
The two written contracts, construed together, clearly show that the defendant, in buying the material and labor from the plaintiff, was acting as the agent of the owner of the building, and that it (the defendant) was not liable under the first count of the petition. The second count, however, presents a different question. While this count might have been subject to special demurrer, it set out a cause of action against the defendant as agent of the owner of the building, and should not have been dismissed on general demurrer. This is true notwithstanding the fact that the plaintiff was not a party to the contract entered into by the defendant and *410the owner. “'An action for money had and received lies in all cases where another has received money which the plaintiff, ex aequo et bono, is entitled to recover and which the defendant is not entitled in good conscience to retain/ . . In such an action 'the law implies a promise on the part of any person who has received the money of another to pay that person on demand. The reception of money by one and the demand by the other makes all the privity that is necessary to maintain this action’.” Haupt v. Horovitz, 31 Ga. App. 203 (130 S. E. 425), and cit. The principle of the foregoing decision is controlling in the instant case, and the court erred in sustaining the general demurrer to the second count of the petition and in dismissing the petition. The cases cited in the brief of counsel for the defendant in error are distinguished by their particular facts from this case.
Judgment reversed.
Luke and Bloodworth, JJ., concur.