Verification code received via WhatsApp
Why I am receiving the verification code via my WhatsApp instead of getting a text message when I login to my AppleID account
Why I am receiving the verification code via my WhatsApp instead of getting a text message when I login to my AppleID account
Two Factor Verification codes are only sent when you log into your account from a new device or new browser. They are sent using either SMS Text, Push Notification to Trusted Device, or Phone Call.
Get a verification code and sign in with two-factor authentication - Apple Support
It's not something Apple is sending you. See the article at the link Mac Jim ID posted. Best case scenario is it is some other service sending you one that way. Worst case scenario is it is phishing.
Verification code received via WhatsApp