Skip to main content

Phone Number Normalization

All numbers must be strictly normalized into E.164 format to ensure compatibility with the Meta WhatsApp API.

Core Library​

We utilize google-libphonenumber for deterministic parsing.

Country Detection Logic (Priority Order)​

  1. Explicit + Prefix: If the number starts with +, trust the explicit country code (e.g., +44 7700 900077).
  2. Known Dialing Prefixes: Look for international exit codes like 00 or 011 mapping to known country prefixes.
  3. Default Upload Country: The API accepts an optional defaultCountry ISO-2 code (e.g., IN for India) during upload. Numbers missing a + are parsed against this locale.
  4. Majority-Country Heuristic: If no default is provided, the chunk processor analyzes the first 100 explicitly prefixed numbers. If 90% are +91, it infers IN for ambiguous numbers.
  5. Ambiguous Warning: If inference fails, the number is marked as a Warning/Error depending on strictness settings.

Inference Flow​