Synchronous Validation Errors

Synchronous (via HTTP) validation errors are returned with status code 400 on submission to the API. The cause of the validation error is returned as content (body) in the response. When synchronous validation errors occur, the submission is immediately rejected and not processed further until the error(s) are corrected and resubmitted. If there are no synchronous validation errors, the response will have status code 202 and contain a field "requestId" which is used to check for asynchronous validation errors during further processing.

Content Format of Synchronous Validation Errors

Validation errors are returned as one or more objects in a list "validationErrors". The content of the list is one or more objects that indicate which fields caused the validation error specified in the field "field", and the cause of the error specified in the field "error".

{
  "validationErrors": [
    {
      "field": "${fieldWithErrorOne}",
      "error": "${validationErrorCauseOne}"
    },
    {
      "field": "${fieldWithErrorTwo}",
      "error": "${validationErrorCauseTwo}"
    }
  ]
}

 




Missing or Blank ("") Required Fields

Response

{
  "validationErrors": [
    {
      "field": "${fieldname}",
      "error": "must not be null"
    },
    {
      "field": "${fieldname}",
      "error": "must not be blank"
    }
  ]
}

Cause

Required fields are missing or have empty values. Fields that cannot have empty values will return "must not be blank" whether they are missing or empty. All other required fields will return "must not be null" if they are missing.

Correction

The field must be included ("must not be null") or must be included and have a value ("must not be blank").

Incorrect Date/Time Format

Response

{
  "validationErrors": [
    {
      "field": "${fieldname}",
      "error": "invalid ISO-8601 instant in UTC (yyyy-MM-ddTHH:mm:ssZ)"
    }
  ]
}

Cause

Date and time fields have incorrect format. They must follow the ISO-8601 standard. That is, be in the format: yyyy-MM-ddTHH:mm:ssZ

Correction

Change the format to follow the ISO-8601 standard in the format yyyy-MM-ddTHH:mm:ssZ.

Incorrect Field Size – Numbers

Response

{
  "validationErrors": [
    {
      "field": "${fieldname}",
      "error": "numeric value out of bounds (<${maxInteger} digits>.
                <${maxDecimalNumber} digits> expected)"
    }
  ]
}

Cause

A number has been specified that exceeds the maximum number of digits before or after the decimal point ("."). Where only integers are allowed, the number after the decimal point (".", that is maxDecimalNumber) will be 0.

Correction

Change the number to be within the maximum integer (maxInteger value) and maximum number of decimal digits (maxDecimalNumber value).

Incorrect Field Size – String (Text)

Response

{
  "validationErrors": [
    {
      "field": "${fieldname}",
      "error": "size must be between ${minLength} and ${maxLength}"
    }
  ]
}

Cause

The content of the field has exceeded the maximum number of characters or has fewer than the minimum number of characters.

Correction

Change the content to be within the minimum and maximum size.

At Least One of the Fields Must Be Specified

Response

{
  "validationErrors": [
    {
      "field": "${fieldname}",
      "error": "At least one of the following fields should be non null:
                [${fieldOne}, ${fieldTwo}]"
    }
  ]
}

Cause

In some cases, at least one of several fields must be specified. The object specified (fieldname) must contain a value in at least one of the specified fields.

Correction

Ensure that at least one of the specified fields is provided and has a valid value on the object.

Must Have One of the Specified Values

Response

{
  "validationErrors": [
    {
      "field": "${fieldname}",
      "error": "Must be one of [${valueOne}, ${valueTwo}]"
    }
  ]
}

Cause

The field (fieldname) must have a value and can only have one of the specified values.

Correction

Submit the field with one of the specified values.