
    BIEN v. FREUND et al.
    (Supreme Court, Appellate Division, First Department.
    February 25, 1898.)
    1. Counterclaim—Action on Attachment Bond.
    An undertaking on attachment, being executed by the sureties on the understanding that it is to be given to the defendant in the action, for his-benefit, constitutes a contract; so that, in an action thereon after the attachment is vacated, a counterclaim arising out of a contract may, under CodeCiv. Proc. § 501, be set off against it.
    2. Same—Purchase of Outstanding Claim.
    Under Code Civ. Proc. § 502, a defendant who is liable upon a contract which has been assigned to some third party may protect himself against that contract even in the hands of the assignee, by the purchase, at anytime before notice of the assignment, of a cause of action existing against his original creditor at the time of the assignment.
    Appeal from trial term.
    Action by Franklin Bien against Max Freund and another. From? a judgment entered on a verdict, and from an order denying a new-trial, defendants appeal.
    Reversed.
    Argued before VAN BRUNT, P. J., and BARRETT, RUMSEY-. PATTERSON, and O’BRIEN, JJ.
    Maurice Sichel, for appellants.
    Franklin Bien, in pro. per.
   RUMSEY, J.

The defendants, as sureties for certain persons who were about to sue out a warrant of attachment against one Buchner., executed the usual undertaking upon attachment, which was delivered to Buchner at the time of the execution of the warrant. The attachment having been vacated, the plaintiff, to whom the undertaking and! the right of action thereon had been assigned, brought this action to recover the damages suffered by Buchner by reason of the attachment. The defendants sought to set off against this cause of action a counterclaim, which will be more particularly referred to hereafter; but they were not permitted to do so for the reason that the action upon the-undertaking was held not to be an action upon contract, and for that reason it was determined by the learned court that a counterclaim upon contract could not be set off against it.

The first question presented upon this appeal, therefore, is as to the nature of the obligation assumed by the defendants when they executed the undertaking upon the attachment. It was a voluntary-agreement upon their part, by which they assumed a liability to the effect that the plaintiffs in the attachment suit would pay all the costs which might be awarded to the defendant therein, and the damages which he might sustain on account of the attachment. By reason of this undertaking on their part, the law implied an agreement that they would pay these costs and damages if the plaintiffs in the original action did not do so. This undertaking, to be sure, did not run in terms to any particular person, but it was given to the defend ants in their action, and it was understood at the time of its execution that it would be given to him, and that it was for his benefit, and the agreement necessarily to be implied from it was that the defendants would pay to him such costs and damages. Such an agreement is in all its essential elements-a contract, and upon no other theory can any liability upon the part of the defendants who executed the undertaking" be sustained. To make a contract, it is not necessary that there should be an express promise; nor is it necessary that any particular person should be stated as the one to whom the promise is implied. It is sufficient if the circumstances are such that the law creates a duty on the part of the one sought to be charged to pay money or to do any other act,—as to pay the amount of a judgment against him; or, on the part of one who has converted the property -of another, to pay the owner the value of the property, if he chooses to waive the tort; or, where one has by fraud obtained possession of the property or money of another, to pay it back, if the one whose property has been taken sees fit to regard the transaction as a contract, and not insist upon it as a tort. Taylor v. Root, 4 Abb. Dec. 382; Coit v. Stewart, 50 N. Y. 17; Rothschild v. Mack, 115 N. Y. 1, 21 N. E. 726; Andrews v. Bank, 26 N. Y. 298. In the cases cited -above, the action was based upon one of the conditions just referred to, but in each case it was held to be an action upon contract, and ■•such is the undoubted construction in such cases. The law which permits a counterclaim to be set up in an action on contract does not require that the contract which lies at the foundation of the action should be a perfect formal contract; but it includes an action arising from a transaction by reason of which the law implies a contract liability. In each one of the cases cited above, a counterclaim upon contract was permitted to be interposed, although the cause of action in each case was one in which the circumstances were such that the law implied an agreement, although in neither of them was any agreement actually made. We have spoken of these elementary rules because the question whether an action upon an undertaking of this kind is one upon contract, so that a counterclaim can be interposed in the action, seems to have been denied in one case at least in this ■state. Furber v. McCarthy, 54 Hun, 435, 7 N. Y. Supp. 613. But numerous other cases in this state may be cited holding the contrary •of this proposition, and the case itself, we think, is not correctly decided. Delaney v. Miller, 78 Hun, 18, 28 N. Y. Supp. 1059; Atwater v. Spader, 12 N. Y. St. Rep. 506; Cornell v. Donovan, 14 Daly, 295; Wickham v. Weil (Com. Pl.) 17 N. Y. Supp. 518. The court was clearly wrong, therefore, in holding that a counterclaim upon •contract could not be interposed in this action.

But the judgment is sought to be sustained because it is said that the claim which the defendants endeavored to set up did not belong to them at the time when Buchner transferred the cause of action upon the undertaking to the plaintiff in this action. This transfer was made on the 24th of December, 1896, and from that time the plaintiff became the owner of the cause of action arising upon the undertaking. No notice of the assignment, however, was given to the defendants in this action. At the time when the undertaking was given by the defendants in this action to Buchner, the defendant in the attachment suit, Buchner was indebted to Lehmaier and others, the plaintiffs in that suit, in the sum of $1,000, for money loaned to Buchner. After the attachment was vacated, which took place ob the 7th of February, 1897, and on the 17th day of that month,^ Lehmaier & Co. assigned to the defendants in this action their claim of $1,000 against Buchner, and this action was commenced two days afterwards; and the defendants here, then being the owners of the claim against Buchner, set it up as a counterclaim against the cause of action which Buchner had assigned to the plaintiff, and upon which this action is brought. The plaintiff claims that when he obtained his assignment, in December, 1896, he took a cause of action against the defendants upon their undertaking, subject only to the ascertainment of the amount of the damages at the time when the attachment should be vacated, and that that cause of action became perfect by the entry of the order vacating the attachment on the 7th of February,. ■ 1897; and he insists that no claim against Buchner thereafter assigned to these defendants could be set up as a counterclaim against the cause of action which had become perfect before such assignment was made. But, in making that claim, the plaintiff overlooks the-peculiar wording of the section of the Code which authorizes the setting up of a counterclaim. That section prescribes as one of the-rules to which a counterclaim is subject that if the action is founded upon a contract which has been assigned by a party thereto, other than a negotiable promissory note, a demand existing against the-party thereto at the time of the assignment thereof, and belonging to the defendant in good faith, before notice of the assignment, must be allowed as a counterclaim. Code Civ. Proc. § 502. It will be noticed from this provision of the Code that a defendant who is liable upon a contract which has been assigned to some third party may-protect himself against that contract even in the hands of the assignee, by the purchase of a cause of action against his original creditor at any time before notice of the assignment. If the plaintiff desires to avoid such a counterclaim, it is his duty to give notice to the debtor of the assignment to him; and, until he does so, that debtor is-in a situation to avail himself of any counterclaim against the assignor of the contract of which he becomes possessed. Faulknor v. Swart, 55 Hun, 251, 8 N. Y. Supp. 239. Therefore the defendants in this action were acting within their rights when they purchased this claim, which they now seek to set up as a counterclaim; and the court erred in refusing them permission to avail themselves of it.

For these reasons, the judgment and order should be reversed, and the new trial granted, with costs to appellants to abide event. All concur.  