missing_locality

A country with no postcode to name the town was given neither

The operator treats the locality — the town, city or post town — as mandatory, and the address names neither a town nor a postcode that identifies one.

appears in
reason
credits
Free. An address that cannot stand as written never costs a credit.

What it means

A postcode identifies the town, so an address that carries one is not refused for leaving the town out: a British street and postcode, or an American street and ZIP, both stand. This reason is for the countries with no postcodes at all, where the town is the only geography the address has.

A town written on the wrong line, or run into the street line without a separator, can be missed by the parser: send the separated fields when you already hold them apart.

What to do

Fill in `locality` (or put the town on its own line in the written address). Where you hold only a postcode, the postcode endpoint of a country whose directory is installed can supply the town.

Example response

{
    "valid": false,
    "reason": "missing_locality",
    "country": "BS",
    "locality": null,
    "postal_code": null,
    "risk_score": null
}

Abbreviated: a real answer carries all 33 fields, listed in the validate-phone reference.

Related

markdown version: /docs/reasons/missing_locality.md