Elastic Path Commerce Development

Field Validation Errors

Field Validation Errors

Field validation errors can occur on POST and PUT operations. Errors are returned as Structured Messages with Status 400 Invalid Request.

The following field validation errors can be returned.

Message ID Message Fields Example Message Template
field.required field-name '{field-name}' value is required.
field.invalid.size

field-name
min-size
max-size

'{field-name}' value must contain between {min-size} and {max-size} characters.
field.invalid.format

field-name
invalid-value
reg-exp

'{field-name}' value '{invalid-value}' must match the following regular expression: {reg-exp}
field.invalid.email.format

field-name
invalid-value

'{field-name}' value '{invalid-value}' must be a valid email format.
field.invalid.boolean.format

field-name
invalid-value

'{field-name}' value '{invalid-value}' must be a boolean (true or false).
field.invalid.decimal.format

field-name
invalid-value

'{field-name}' value '{invalid-value}' must be a decimal.
field.invalid.integer.format

field-name
invalid-value

'{field-name}' value '{invalid-value}' must be an integer.
field.invalid.datetime.format

field-name
invalid-value

'{field-name}' value '{invalid-value}' must be in ISO8601 date time format (YYYY-MM-DDThh:mm:ssTZD).
field.invalid.date.format

field-name
invalid-value

'{field-name}' value '{invalid-value}' must be in ISO8601 date format (YYYY-MM-DD).
field.invalid.option.value

field-name
invalid-value

'{field-name}' value '{invalid-value}' must match a valid option.