In an action on a promissory note the defendant interposed the defense that the plaintiff, a foreign corporation, had not complied with chapters 69, 70, pp. 68, 71, Laws 1899. The trial court ordered judgment in favor of the defendant, and the plaintiff appealed from an order denying its motion for a new trial. The appellant, under proper assignments of error, contends that the order of the trial court should be reversed, because it was not doing business within the state, and that the transaction in question constituted interstate commerce.
The evidence sustains the finding “that said plaintiff as such corporation was doing business in Minnesota, * * * and that it had agencies established during the year 1903, and during all the time mentioned in the pleadings in said above cause, in various towns and cities in the state of Minnesota, .and stored therein large quantities of its goods, farming implements, and machinery, with the warehouse company at Minneapolis, without reference to contracts previously entered into for their sale.” The appellant is an Ohio corporation, and has not complied with the provisions of chapters 69, 70, pp. 68, 71, Laws 1899.
The evidence shows that its traveling men solicited orders in Minnesota, which were forwarded to Springfield, Ohio, and the goods were *434shipped from that point to a distributing depot in Minneapolis, from whence they were shipped to other parties at various points within the state as ordered. The appellant claims that all goods thus shipped in Minnesota were tagged and marked with the name of the persons by whom they had been ordered and to whom they were to be forwarded. The respondent claims, and the court found, that goods in substantial' amounts were also shipped to this warehouse or depot in Minneapolis without being marked for any particular persons, and that as orders were taken by traveling men they were filled out of this general stock of goods. It appears that the particular goods which are claimed to have been sold to respondent, and for the purchase price of which the promissory note upon which this action was brought was given, were ordered by respondent from a traveling agent, the order approved at Springfield, Ohio, and the goods shipped to a distributing depot at Winona, marked for shipment therefrom to the respondent. There is ample evidence to sustain the finding that the appellant had shipped into the state of Minnesota, and there stored in a warehouse, large quantities of its goods, without reference to contracts previously entered into for their sale. This depot or warehouse was in charge of the International Harvester Company, which acted as distributing agent. The witness Simmons, who during the time in question was bookkeeper and shipper for that company, testified that during the year 1903 the harvester company had a line of machines on hand owned by the Thomas Manufacturing Company, and that there were more goods received from the appellant at the Minneapolis warehouse that were not consigned or sold to any person than there were goods that had been sold prior to their shipment into the state.
The evidence does not sustain the appellant’s contention that the particular transaction out of which this action arose was an act of interstate commerce. It is conceded that sales of goods by a foreign corporation, even through a traveling salesman sent into the state, to -a resident of the state, to be shipped to him in the state, belong to the operations of interstate commerce, and are consequently not subject to the prohibitions of the statute. 19 Cyc. 1230. But the interstate commerce clause does not apply when the foreign corporation maintains a resident agent in the state whose business it is to solicit orders for and deliver the goods of the corporation to the purchaser. Diamond Glue Co. v. U. S. *435Glue Co., 187 U. S. 611, 23 Sup. Ct. 206, 47 L. Ed. 328. A distinction must also be made between the acts of a foreign corporation in shipping its goods to a commission merchant or other agent within a state, to be sold by him and the proceeds accounted for to the corporation, the title of the goods to remain in the corporation until paid for, and the case where a local commission merchant solicits orders for the goods of a foreign corporation and forwards them directly to the corporation. In the latter case the orders are filled by the corporation with the same effect as though they were received direct from the customer. But, if the commission merchant or other agent to whom the goods are consigned acts as the agent of a foreign corporation under an agreement that all the goods, so long as unsold, remain the property of the corporation, and the proceeds of the sales belong also to the corporation, the corporation has established an agency in the state for the sale of its goods and is doing business within the state.
This is illustrated by the case of Com. v. Parlin, 118 Ky. 168, 80 S. W. 791. A corporation engaged in the business of manufacturing farm machinery appointed certain residents of Kentucky having an established place of business, as its agents to sell implements, to be shipped to and stored by them for delivery as sales were made. The contract provided that the title to the goods should remain in the corporation. The manner in which the sales were to be made, the securities which were to be taken, and the manner of rendering accounts were minutely provided for. The contract was held to be one of agency merely, and not a selling by the owners as wholesalers to the alleged agents as retailers. See, also, U. S. Rubber Co. v. Butler Bros. Shoe Co. (C. C.) 132 Fed. 398.
A contract very similar to the one under which respondent received the goods for which his note was given was under consideration in the case of D. M. Osborne & Co. v. Josselyn, 92 Minn. 267, 99 N. W. 890, and held to be a mere contract of agency. The provisions of the contract which led the court to that conclusion are almost all present in the contract between this appellant and respondent.
The agreement on the part of the company is to make for and to sell to Knapp the property specified. Knapp was a local dealer in agricultural implements, and the contract discloses that he was expected to sell the machinery at retail. The territory within which sales *436may be made is carefully defined. Sales in other territory can be made only with written permission of the company. The right is reserved to order away machines when Knapp' has more on hand than is required by his trade. The so-called purchaser agrees, among other things (1) to receive the machines on arrival, pay freight thereon from the factory, and take proper care thereof; (3) to make all reasonable efforts to sell said machines by properly exhibiting them, distributing printed matter, canvassing territory, etc.; (3) not to take the agency or become interested in the sale of other such implements; (4) to order as many more machines as trade in the territory will demand. The title and ownership of all machines which may be shipped as herein provided shall remain in, and their proceeds in case of sale shall be the absolute prop•erty of, the company, and shall be subject to its order until full payment shall have been made for the same. The company also reserves “the right to revoke this contract any time, if second party fails to discharge any obligations entered into as above, or if first party has reason to believe second party unable to perform them, and without being liable for damages to second party by reason of such revocation.” This provision is entirely inconsistent with the theory of the ■sale of specified goods. Attached to and made a part of the contract are certain “instructions,” among which are the following statements :
“We give all our agents privilege to sell to all parties who come to their store to buy, except to dealers in other towns where we have agents, but no agent has privilege of canvassing for sales outside of ■territory named in his contract.” “If any sales are made in violation of the spirit of this contract, by selling machines in territory not specified herein, he shall forfeit and pay over to the Thomas Mnfg. Co., in trust for use of agent controlling such territory, the full commission made from retail price of machines included in this contract, together with any other damages that may be sustained by said agent in consequence of said trespass * * * committed by one agent upon the rights of another agent. Each agent must protect his territory against trespass, same as any other property.”
■■ The terms of this contract make it a contract of agency, and, when we consider the contract in connection with the arrangement for shipping goods to the so-called distributing depots, there is no escape from the conclusion that the appellant was doing business in the state of *437Minnesota. It had not complied with the statute. As said in G. Heileman Brewing Co. v. Peimeisl, 85 Minn. 121, 88 N. W. 441, this-legislation is neither hostile nor unjust to foreign corporations, for its-purpose is to place them upon an equality with domestic corporations, both as to privileges and as to burdens.
It is the duty of the courts of the state to give its provisions full effect and not emasculate them by any technical constructions. It is equally the duty of the courts to see that the statute is not evaded by the adoption of elaborate and complicated methods of business, devised for the purpose of securing the privileges without assuming the burdens of domestic corporations. In an action of this character, the agent is not estopped to plead the defense that the corporation has not complied with the statute and therefore cannot maintain an action to enforce the claim arising out of the forbidden business.
We are referred to certain cases which hold that as against the corporation the agent cannot assert the failure of the corporation to comply with the statute to defeat an action by the corporation to recover-money received by him in the course of his employment. The cases are not precisely in point, and, if they were, they would not meet with our approval. Penn Mutual Life Insurance Co. v. Bratley, 66 Hun, 635, 21 N. Y. Supp. 876, contains a mere statement of the conclusion of the court, and on appeal the decision was affirmed without an opinion. 142 N. Y. 660, 37 N. E. 569. In U. S. Express Co. v. Lucas, 36 Ind. 361, it was held that, while a foreign corporation which had not complied-with the statute could not recover on a bond given by.an agent for the' proper discharge of his duty, it could maintain an action against the agent for money had and received in the course of the agency for the use of the corporation. It was said that the agent was estopped to dispute the title of his principal to the money. The court asks: “Why should an agent be allowed to place, himself in a position of hostility to-his principal and himself claim that which he has received for him ?w This seems to be wide of the mark. The. question is, not what the agent, as between himself and his principal, should be permitted to do, but what the delinquent corporation is permitted to do by the laws of the state. In Hovey’s Estate, 198 Pa. St. 385, 48 Atl. 311, it was held that a foreign corporation which had sold goods to a commission mer*438chant who had guarantied the amount of sales made by him might recover the amount of its claim from the estate of the merchant.
This court has consistently adhered to the rule that there can be no recovery upon a contract entered into in direct violation of the law. Ingersoll v. Randall, 14 Minn. 304 (400); Bisbee v. McAllen, 39 Minn. 143, 39 N. W. 299. Foreign corporations are denied the right to resort to the courts for the purpose of enforcing any claim arising out of business which they are forbidden to transact in the state without having first complied with the requirements of the statute. The terms of the statute are in no wise burdensome. In order to secure compliance therewith, the legislature has imposed a penalty upon the corporation, and in addition thereto has withdrawn the privilege previous^ enjoyed through comity of maintaining actions in the courts of the state. It is expressly provided that “no corporation which shall fail ■to comply with the provisions of this act can maintain any suit or ■action, either legal or equitable, in any of the courts of this state upon ■any demand, whether arising out of contract or tort.” No limitations •are expressed, and no exceptions can be implied. The corporation must ■comply with the law, or the courts of the state are closed to it. The statute expresses a clearly defined public policy, and it is inconceivable that in the face of this prohibition a foreign corporation may, without complying with the statute, establish an agency within the state, proceed to transact business in violation of the statute, and, when its agent neglects to account for money received in the course of such business, bring an action in the state court against the agent and be heard to assert that the agent cannot raise the question of the right of the corporation to maintain the action. This would be to make the public policy of the state subsidiary to the propriety and policy of a rule of private law which forbids an agent to question the right of his principal to money collected by him for the principal. Such a rule entirely ignores the broad and controlling rights of the public.
In t-he present case, for instance, the question is not whether Knapp is under a moral and legal obligation to pay this note or to account for money which he has received as the agent of the appellant. Knapp’s rights and obligations are matters of secondary importance in the face ■of the statute, which declares that the corporation cannot maintain any action upon any demand, whether arising out of contract or tort. As *439•far as the right to raise this question is concerned, it is immaterial whether the action is upon a promissory note, or to recover money received by an agent for the use of his principal. The doctrine of estoppel cannot be applied to enable a person or corporation to do what is forbidden by law. Seamans v. Christian Bros. Mill Co., 66 Minn. 205, 68 N. W. 1065; In re Comstock, 3 Saw. 218, Fed. Cas. 3,078; Cincinnati v. Rosenthal, 55 Ill. 85, 8 Am. 626.
The cases which hold that a defendant in a criminal prosecution, ■charged with embezzlement of money from a corporation, cannot assert the noncompliance of the corporation with the statutes as a defense, are manifestly inapplicable. A prosecution is brought by the state itself, and the right of the corporation to do business in the state is in no way involved.
The order of the trial court is therefore affirmed.