As the doctrine by which an undisclosed principal is given rights and subjected to liabilities under a contract made professedly with another is somewhat artificial, and is adopted for the promotion of justice, courts will so limit the doctrine as to advance the ends of justice; and, therefore, will allow defences to actions by and against the principal when the situation is such as to make it equitable. Thus in an action by the principal against the person with whom the agent contracted, the defendant is entitled to take advantage of any settlement made with the agent while still believing him to be a principal; 42 or to set off against the undisclosed principal a debt due from the agent on another account, 43 unless the debt was created after the agency was disclosed.44 But if the defendant knew that the agent was acting as such, though his principal was not named, a set-off of claims against the agent cannot be made against the principal.45
"The buyer must be cautious, and not act regardless of the all other cases where the plaintiff is allowed to charge the principal, he thereby loses his right against the agent. But though a defence may arise to a judgment actually recovered against the agent, the judgment itself cannot be cancelled by a suit against the principal or a judgment in that suit. The court is in reality allowing at law what might more logically be achieved by a rescission in equity of the first recovery. Cf. other cases of election, infra, Sec.Sec. 683,684, 736, 1304, 1374, 1407,1464, 1524,1594.
Deo. 727; Huntington v. Knox, 7 Cush. 371; Norcross v. Pease, 5 Allen, 331.
42Doucette v. Baldwin, 194 Mass. 131, 135, 80 N. E. 444.
43 Rabone v. Williams, 7 T. R. 360 (notes); George v. Clagett, 7 T. R. 359; Borries v. Imperial Ottoman Bank, L. R. 9 C. P. 38; Montagu v. For-wood,  2 Q. B. 350; Beatty v. Heath (Mo. App), 183 S. W. 1102; Hudgins Produce Co. v. Beggs (Tex. Civ. App.), 185 S. W. 339. See Lime Bock Bank v. Plimpton, 17 Pick. 159.
44 Norcross v. Pease, 5 Allen, 331.
45Hornby v. Lacy, 6 M. & 8. 166.
rights of the principal, though undisclosed, if he has any reasonable grounds to believe that the party with whom he deals is but an agent. Hence, if the character of the seller is equivocal, if he is known to be in the habit of selling sometimes as principal and sometimes as agent, a purchaser who buys with a view of covering his own debts and availing himself of a set-off is bound to inquire in what character he acts in the particular transaction; and if the buyer chooses to make no inquiry, and it should turn out that he has bought of an undisclosed principal, he will be denied the benefit of his set-off."46 Even though the claims against the agent which the defendant seeks to set off against the principal were acquired after the transaction with the agent, and indeed after the agent ceased to represent the principal, the claims may, nevertheless, be set off against the principal if, when they were acquired, the existence of the principal was still undisclosed.47 Further, if agents make a single sale of goods belonging in part to themselves and in part to a principal whose existence is not disclosed, since the contract is indivisible, the principal cannot sue for the proportion of the price payable on the goods which belong to him.48 The same principles are applicable to any other defences. If good against the agent, they are good against the principal.49 But defences acquired through dealing with the agent after notice from the principal of his rights cannot be used by the other party.50 Nor can he use against the principal any defence against the agent where he has such knowledge in regard to the agency as to make it a fraud for him to assert the defence.51
46Miller v. Lea, 86 Md. 396, 406, 6 Am. Rep. 417. See also Cooke c. Eshelby, 12 A. C. 271; Baxter v. Sherman, 73 Minn. 434, 76 N. W. 211, 72 Am. St. Rep. 631.
47Stebbina p. Walker, 46 Mich. 6, 8 N. W. 521.
48 Roosevelt v. Doherty, 129 Man. 301, 37 Am. Rep. 356.
49Semenza v. Brinaley, 18 C. B. (N. S.) 467; Mildred v. Maspona, 8 A. C. 874; Lane v. Letter, 237 Fed. 149, 150 C. C. A. 296; Amann v. Low-efl, 66 Cat 306, 6 Pac. 363; Pod v.
Shepherd, 58 Ga. 365; Baltimore Tar Co. v. Fletcher, 61 Md. 288; Illsley v. Merriam, 7 Cush. 242, 54 Am. Dec. 721; Houghton v, J. W. Hundley Co. (Okl.), 157 Pac. 1142.
50 Norcross v. Pease, 5 Allen, 831.
51 Mildred v. Maspona, 8 A. C. 874; Childers v. Bowen, 68 Ala. 221; Miller v. Les, 35 Md. 396, 6 Am. Rep. 417; McLachlin v. Brett, 106 N. Y. 391, 12 N. E. 17; Frame v. William Penn Coal Co., 97 Pa. 309.