WhatsApp expects businesses to be upfront and transparent with their customers about how the platform will be used to deliver notifications and messages to them—and exactly what these messages will contain. Opt-in, therefore, plays a crucial role in setting up your service.
First, the customer can only give their consent via a 'third party channel', an opt-in form on one of the business's existing communications channels, such as email, website, SMS, app, dedicated landing page, etc. Opt-ins should be active, meaning that the customer must actively show their consent by entering/editing a phone number or by checking a box.
Secondly, businesses must be clear on what customers are signing up to—and what type of information they will receive once they have consented.
Find more information about how to implement opt-in here.