FieldResult

interface FieldResult { valid: boolean | null; value?: string; error?: ValidationError<FieldError>; }

What POST /v1/validate answers for one field: whether its value is one the country takes, and the value to submit for it. Every field's answer has these keys, and a field the route checks extends them with its own:

FieldDescription
phone_numberPhoneNumberResult
postcodePostcodeResult
any other{ "valid": null }

The example is city, which the route does not check.

Example

CODE
{ "valid": null }

Properties

valid: boolean | null

true when the value is one the country takes, false when it is not, and null for a field this route does not check, or cannot check in that country.

value: string

What to submit for the field, where valid is true.

error: ValidationError<FieldError>

Where valid is false, why, as a code and a message.