This is the single most expensive IP mistake I see startups make, and it usually surfaces during due diligence, at the worst possible moment.
The default rule
Section 17 of the Copyright Act, 1957: the author of a work is the first owner of the copyright in it. For software, the author is the person who wrote the code. There is an exception where a work is made by an author in the course of employment under a contract of service, in which case the employer is the first owner absent an agreement to the contrary.
Why a freelancer is different
A freelancer or agency works under a contract for services, not a contract of service. They are not your employee. The employment exception therefore does not apply, and copyright stays with them unless assigned. India has no broad American-style "work made for hire" doctrine that automatically vests commissioned software in the person paying for it. The narrow commissioning provision in Section 17(b) covers photographs, paintings, portraits and engravings, not code.
Paying the invoice buys you a licence to use what was delivered, at most, and the scope of even that licence will be argued about. It does not make you the owner. An investor's lawyer will ask for the chain of title to your core technology, and "we paid them" is not an answer.
The fix
A written assignment complying with Section 19: signed by the assignor, identifying the work, the rights assigned, the duration and the territory. If duration is omitted it is presumed to be five years; if territory is omitted, India only. Both defaults are fatal for a technology company, so state them expressly as perpetual and worldwide.
A proper development agreement should also cover:
- Assignment of all IP created under the engagement, present and future
- A waiver of moral rights so far as permissible, since moral rights under Section 57 are not assignable
- Disclosure and licensing of any third party or open source components, with the licences named. An unnoticed copyleft licence can be a bigger problem than the assignment
- Delivery of source code, documentation and repository access
- Confidentiality, and a warranty of originality with an indemnity
If the work is already done
Get a confirmatory deed of assignment signed now. Most freelancers will sign one, particularly if there is an ongoing relationship. It is far cheaper than the alternative.