The demurrer to the petition should have been sustained. If the petition is construed as one for a money rule under Code § 9-617, it did not allege the essentials of a money *151rule. A right to a money rule under this Code section depends upon the existence of the relation of attorney and client, and is limited to the client. Breen v. Phillips, 169 Ga. 13 (1a) (149 S. E. 565); Knight v. Rogers, 22 Ga. App. 308 (95 S. E. 997); Smith v. International Lawyers, 35 Ga. App. 158 (132 S. E. 245). In the instant case, there was no relationship of attorney and client between the plaintiff and the defendant Endicott.
The petition did not state a cause of action under any theory. Attorney’s fees contracted for in instruments such as the one foreclosed in case number 212491, referred to in the statement of facts, are for the benefit of the vendor under the retention-of-title contract and not for the benefit of his attorney. Carson v. Blair, 31 Ga. App. 60 (2) (121 S. E. 517). The defendant Endicott, as attorney for the Duprees, was the Duprees’ agent as to the whole proceeding. It was not alleged that Endicott had not accounted to his clients in full for the disposition made of the property, and that he had money or property of the clients with which to answer the “rule.” In an action of this kind such an allegation was essential. No fraud or bad faith on the part of Endicott in the procurement of the judgment for attorney’s fees was alleged. The funds which Endicott realized for his clients out of the disposition of the property were lawfully acquired. McDonald v. Napier, 14 Ga. 89 (3). Attorney Endicott was not guilty of any misconduct in connection with the judicial proceeding which would give the court an opportunity to invoke those inherent powers it has over its officers to correct any effects of misbehavior of such officers in connection with judicial proceedings. Where money is mistakenly paid to an agent and he, without notice of such mistake, turns the money over to his principal, resort must be had against the principal and not the agent for the recovery of the money mistakenly paid to the agent. McDonald v. Napier, (headnote 1), supra; Pratt v. Foster, 18 Ga. App. 765 (2) (90 S. E. 654); Code, § 4-403. The fact that the principals are non-residents does not alter this principle of law. The plaintiff did not allege that Endicott had notice of the mistake before he presumably accounted to his principals; therefore he could not be held liable for the mistakenly paid attorney’s fees.
It is not necessary to rule on the other exceptions.
*152The Appellate Division of the Civil Court of Fulton County ■ erred in affirming the judgment of the trial court overruling the demurrer to the petition.
Judgment reversed.
Sutton, C.J., and Worrill, J., concur.