Depending on country to country or state to state, it may vary. But in general, there are certain legal requirements all businesses need to fulfil like registering your business with the relevant government authorities. This might entail adopting a legal structure, registering for taxes, and acquiring a company licence, registering for a trademark on your business name, logo and products or services. There are others like payment gateways, consumer protection laws, privacy policies and terms of service. It is best to fully research the laws and requirements for the hassle-free functioning of your business.