Skip to content

Validation failed

HTTP 422validation_failed

When the API answers 422 validation_failed, and how to fix it.

Version v1.1, updated

The type field of every validation_failed response links to this page.

On this page

A query parameter, a header or a field of the body is invalid. errors lists each one, with its field path and a message.

At a glance

  • Status: 422 Unprocessable Content

  • Code: validation_failed

  • Retry: No. Fix the cause first: the same request gets the same answer.

Causes and fixes

Likely cause

How to fix it

A decimal is sent as a JSON number, such as 12.5.

Send it as a string, such as "12.50". See Decimal strings, dates and ids.

The body has a field the operation does not take, or a misspelled name.

Remove the field or fix its name.

A value is out of range or in another format, such as limit=500 or a date written 05/10/2026.

Keep limit between 1 and 200, and write dates as YYYY-MM-DD.

An invoice body sends totals or VAT.

Leave them out: BIRP computes them.

Fix every entry of errors, then send the request again. Each field is a path into what you sent, such as lines[1].unit_price.

Example

422 validation_failedJSON
{
  "code": "validation_failed",
  "detail": "One or more request parameters are invalid.",
  "errors": [
    {
      "field": "limit",
      "message": "must be between 1 and 200"
    }
  ],
  "instance": "/v1/categories",
  "request_id": "a1b2c3d4-0000-4000-8000-0000000000ee",
  "status": 422,
  "title": "Validation failed",
  "type": "https://birp.io/developers/errors/validation_failed"
}
  • errors-overview
  • formats
  • handling-errors