unknown_country
No postal format is published for that country
The country code parses, but the address format table carries no format for it, so there is no layout, no required-field list and no postcode pattern to measure the address against.
- appears in
- reason
- credits
- Free. An address that cannot stand as written never costs a credit.
What it means
Spaw measures an address against its own country: which parts that operator requires, how the lines are ordered, and what shape the postcode takes. The table behind that (named `address-formats` in `sources`) covers the countries and territories with a published format; a code outside it — a user-defined code such as `ZZ`, or a territory with no format of its own — leaves nothing to check.
The API endpoints validate `country` against the same table before the lookup runs, so a request naming an unknown country answers `422 VALIDATION_FAILED` instead. This reason is what the lookup itself answers.
What to do
Send the ISO 3166-1 alpha-2 code of the country the post is addressed to. For a territory with no format of its own, use the code of the operator that delivers there.
Example response
{
"valid": false,
"reason": "unknown_country",
"country": "ZZ",
"country_name": null,
"postal_code_type": null,
"risk_score": null
}Abbreviated: a real answer carries all 33 fields, listed in the validate-phone reference.
Related
- empty_address · nothing in the request was an address
- missing_street · the country requires a street line and none was found
- missing_locality · a country with no postcode to name the town was given neither
- missing_administrative_area · a country with no postcodes needs the state or province
- missing_postal_code · the country requires a postcode and none was given
- invalid_postal_code · the postcode is not the shape that country uses
- postcode_not_found · the postcode is well formed but is not in the directory
- All verdict reasons
- Phone fields and the risk score
- API reference
markdown version: /docs/reasons/unknown_country.md