The petition in this case alleges that plaintiff is a corporation incorporated under the laws of the State of Iowa, but makes no statement as to whether or not it has complied with the laws of this State relating to foreign corporations. The petition then declares upon two promissory notes alleged to have been exe*443cuted by defendant. To this petition the defendant demurred upon the ground that it did not show that plaintiff had capacity to sue and that it did not state a cause of action. This demurrer was sustained and plaintiff has appealed.
As the cause of action stated was in proper form, the court must have sustained the demurrer to this petition upon the ground that it did not state that plaintiff had complied with the laws of this State authorizing foreign corporations to do business in this State. It is true that a foreign corporation who has not complied with the laws of this State cannot maintain an action in the courts of this State, but this is a matter of defense, and to be available, must be pleaded by the defendant; hence, it is not necessary for plaintiff to allege in its petition that it had complied with the provisions of our statutes in relation to foreign corporations, and a demurrer ought not to be sustained for that reason. [Scientific American Club v. Horchitz, 128 Mo. App. l. c. 579, 106 S. W. 1117; Parlin & Orendorf Co. v. Boatman, 84 Mo. App. l. c. 72; The American Insurance Co. v. Smith, 73 Mo. l. c. 371; United Shoe Machinery Co. v. Ramlose, 210 Mo. 631, 109 S. W. 567.]
The action of the court in sustaining this demurrer was error. The judgment is, therefore, reversed and the cause remanded.
All concur.