ValidationError
interface ValidationError<Code extends FieldError = FieldError> {
code: Code;
message: string;
}Why a value does not pass, as POST /v1/validate answers it: a code to branch on, and the sentence to show the shopper.
The example is the US ZIP Code 10001 sent with state: "CA".
Type Parameters
CodeextendsFieldError=FieldError
Example
CODE
{ "code": "not_in_state", "message": "Enter a valid ZIP Code for California" }Properties
code: Code
What is wrong, as a FieldError: the same key the field's message is under in GET /v1/locales/:lang, for a page that writes its own.
message: string
What to show under the field, in the response's lang, with every value filled in: the example, and the state's name.