Determining the jurisdiction of a case, which is essential in order for a court to be able to have the power to determine the rights of parties in a case, is a very difficult matter. When a contract or matter occurs in one state that normally gives the courts of that state the authority to call a party into court. For example, when a driver from MO drives their car into Oregon and has an accident in Oregon, any person involved in that OR accident can normally file a case against the MO driver in the OR courts because the fact that the accident occurred in OR gives them that right. When it comes to corporations from different states entering into a sale, unless they have a written contract of sale between them that specifically limits them to only filing cases against each other due to that sale in one of their states (normally called a "forum selection" or "governming law" clause), then the parties are often left to determine where (in which state) the sale or failure to pay took place in and what state, based on the rules of civil procedure or other laws, they can file suit in.
Unfortunately, many states have laws that a corporation cannot file a case in their courts, unless the corporation has registered itself with the state as a "foreign corporation." Or, many states do not allow persons who own corporations to represent the company in court, considering that to be the unauthorized practice of law because persons are separate from the corporations they own and only an attorney can represent a corporation. Perhpas these issues may have happened in your earlier case based on what you say. However, if it is possible to say that the current company that owes your company money exposed itself to CA courts when it contacted your company for a purchase, which is normally done through a determination of whether the company had "minimum contacts" with the state of CA to grant the CA courts jurisdiction over them, that may allow you to file a suit in CA courts. This is a tricky and detailed matter, however, and one of the most difficult matters discussed in law school and by the courts. You would need to hire an attorney in CA who would review all dealings and transactions with this NY company to see if, in fact, the required contacts with the state of CA or the sale occured in CA to see if CA courts could have jurisdiction over the NY company.
Although having the NY company contact your offices would normally strengthen the argument that the "sale" occurred in CA, it is not that simple. The entire sales transaction, from beginning to end, often needs to be reviewed to see where the final act which resulted in a sales contract being put in place took place and then jurisidiction would normally be said to be had by the courts of that jurisdiction.
Because you are located in CA, you may want to speak to an attorney in CA, perhaps one who works in a firm which has a NY branch, to have them review the relationship between the two companies, where the "sale" or contract can be said to have occurred, and then, to advise you on where and how to file suit. Moreover, courts in any jurisdiction often do require attorneys to represent the interests of the corporation, such as collecting a debt, and do not permit the owners or managers of a corporation to represent the corporation in court, so any action would normally have to be taken by an attorney. Also, you may want to speak to an attorney in CA about creating sales contracts for you that in the future contain proper clauses to allow you to file suit against your customers who are outside CA in the courts of CA and that otherwise protect your company's rights.