Check address parts offline
Checks address parts the way every address write does, without saving anything and without asking an outside service. Returns the parts as a write would store them (trimmed, the postal code in the country's format, a region name or ISO code turned into the country's region code), the issues, and the cities and regions the postal code directory lists for the postal code, with the centre of the postal code. Errors (countryUnknown, postalCodeInvalid, regionInvalid) make a write with these parts fail with 422; warnings (countryMissing, partMissing, regionUnknown, postalCodeRegionMismatch, cityMismatch) are returned with the write result. The country formats come from Google's libaddressinput metadata (CC BY 4.0) shipped with the app. The postal code directory holds GeoNames postal codes (CC BY 4.0) in this server's own database: a country is loaded the first time someone enters one of its postal codes, so the first check can answer status loading; show the attribution with places.
Requires: an active member of the workspace; no record permission, because a check changes nothing.
Authorization
apiKeyAuth API key authentication. Create an API key in your user profile and include it in the x-api-key header.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://customermates.com/api/v1/addresses/check" \ -H "Content-Type: application/json" \ -d '{ "street": "Hauptstr. 5", "postalCode": "68259", "city": "Mannheim", "countryCode": "de" }'{
"address": {
"street": null,
"line2": null,
"postalCode": null,
"city": null,
"region": null,
"countryCode": null,
"formatted": "",
"location": null,
"verification": {
"status": "unverified",
"provider": null,
"checkedAt": null
}
},
"issues": [
{
"code": "countryUnknown",
"severity": "error",
"part": "street",
"message": "string",
"example": "string",
"expected": [
"string"
]
}
],
"postalCode": {
"status": "ready",
"match": "exact",
"places": [
{
"city": "string",
"region": "string",
"location": {
"lat": -90,
"lon": -180,
"precision": "postcode"
}
}
]
},
"attribution": "string"
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}