Learned Mr. Nadeem has given valuable advice. Kindly follow it.
It seems that at the most it can be job work, project work. However there is no specific contract.
It is felt that there is nothing on record e.g. offer letter, appointment letter.
You may supply a written notice (which you can also send) to supply you the payment within say......7 days.
If you have decided not to entertain any job work in future from them, you can take a printout out of all chatting messages and approach your lawyer.
Legal notice from your lawyer may work. To avoid contracting a lawyer at your location, attending to courts etc, suffering expenses, company feel that paying you shall be better option. If nothing works, you may have to move competent court of law. You can also visit local o/o Labor commissioner and meet the wages/labor inspector and obtain their qualified advice.
Company's logic that the principle company has not paid them shall not work.