In an action in this court, wherein George H. Nicholas was plaintiff and the plaintiffs herein were defendants, the defendant herein, on November 4, 1914, executed an undertaking, for the purpose of enabling Nicholas to obtain a warrant of attachment against property of the defendants therein (the plaintiffs herein), which was presented to and approved, ex parte, by a justice of this court, wherein it undertook that ‘1 if the defendants, Sterling Manufacturing Company and Reliance Manufacturing Company recover judgment in this action or the warrant of attachment is vacated the plaintiff will pay all costs which may be awarded to the said defendants and all damages which the said defendants may sustain by reason of the said attachment not exceeding the sum of $250.” A levy was made under the warrant of attachment; and the defendants recovered judgment *606in the action wherein it was levied. Consequently, the contingency under which the defendant became liable upon its undertaking arose. It failed to discharge its obligation upon its undertaking, and the plaintiffs (the defendants in the. former action) commenced this action thereupon to recover their damages.
The defendant pleads, as a defense, that the plaintiffs are foreign stock corporations, other than moneyed corporations; that, at the time the undertaking was executed, they were doing business in this state and that they did not obtain leave to do business within this state, and urges that, because of the provisions of section 15 of the General Corporation Law, providing that no foreign stock corporation, other than a moneyed corporation, doing business in this state “ shall maintain any action in this state upon any contract made by it in this state, unless prior to the making of such contract it shall have procured such certificate,” they cannot recover; and the plaintiffs demur to this defense as being “ insufficient in law upon the face thereof.”
Counsel frankly concede that they have not been able to find a case directly in point; so it devolves upon me to determine the question presented upon the statute itself and the decisions which have been rendered in construing it in other aspects.
The failure of a foreign corporation to obtain leave to do business within this state does not render invalid a contract made here by it prior to the obtaining of such leave. Mahar v. Harrington Park Villa Sites, 204 N. Y. 231. The other party may, nevertheless, maintain an action against the foreign corporation upon such a contract; and it may defend such an action and even set up a counterclaim arising out of the same transaction. J. R. Alsing Co. v. New Eng*607land Quartz & S. Co., 66 App. Div. 473; affd., 174 N. Y. 536. It may also sue upon such a contract in the courts of the United States. Groton v. American, 151 Fed. Rep. 871. If it sue upon a contract made by it here it is required to plead the condition precedent that, prior to the making of the contract, it has obtained leave to do business here (Welsbach Co. v. Norwich Gas & El. Co., 96 App. Div. 52; affd., 180 N. Y. 533); and its failure to pay the franchise tax in accordance with the provisions of section 181 of the Tax Law, which is closely related to section 15 of the General Corporation Law, is available, as a condition subsequent, to the defendant as a defense. C R. Parmele Co. v. Haas, 171 N. Y. 579. Consequently, the only effect of not complying with the statute is to deprive it of access to the state courts as a party plaintiff in an action upon its contract; and the effect of complying with the statute is to place it upon the same footing as a litigant as a domestic corporation. Lancaster v. Amsterdam Imp. Co., 140 N. Y. 576.
A foreign corporation has the same right to sue in this state as a domestic corporation, “ except as is otherwise specially prescribed by statute ” (Code Civ. Pro., § 1779; Portland Co. v. Hall & Grant Const. Co., 121 App. Div. 779); and, in order to be deprived of this right, it must be brought within the terms of some express prohibition. C. R. Parmele Co. v. Haas, 171 N. Y. 579.
It is to be observed that the provisions of section 15 of the General Corporation Law, relied upon, do not preclude a foreign corporation from maintaining an action upon all contracts but that the prohibition relates only to contracts “ made by it ” within the state. The undertaking upon which the plaintiffs sue was not made by them. It was made without their *608knowledge or consent, express or implied, and against their will. It was a contract made by the defendant for their benefit; and, as such, it is, of course, enforceable by them. Little v. Banks, 85 N. Y. 258. I do not think, therefore, that the undertaking is such a contract as is contemplated by the provisions of the statute. A .correct construction of the statute can best be gained by having recourse to its object, which, evidently, is to prevent foreign corporations from making contracts here without first having obtained leave to do so and thereby rendered themselves amenable to the authority of the state government for the purposes of taxation and other governmental control, by leaving them without redress as to such contracts as they may make in defiance of the statute. In other words, the state, by this statute, gives them notice that' if they make contracts here, without having subjected themselves to its authority, they do so at their peril; but I think that this is the limit of the penalty prescribed for a failure to observe the statute and that it was not intended to thereby close the courts to a foreign corporation as to all contracts affecting it. Mahar v. Harrington, 204 N. Y. 231. A foreign corporation, notwithstanding that it has not obtained leave to do business here, may maintain an action in the courts of this state upon a contract made in another state. Great Northern M. Co. v. Bonewur, 128 App. Div. 831. I do not think that the conclusion reached in South Bay Co. v. Howey, 190 N. Y. 246, is in conflict with the view herein expressed; because, in that case, the contract was delivered to the foreign corporation and was, therefore, evidently procured by it as a part of the business which it was transacting here in violation of the statute. Here the plaintiffs took no part whatever in procuring the undertaking, which was approved by and filed with the court.
*609Counsel for the defendant, in his brief, also relies upon section 181 of the Tax Law; but the failure to comply with this statute was not pleaded in the answer; and it would not make any difference in the result if it were.
The demurrer is sustained, with costs.