What are the different API error response types and how to understand them?

Hi, in the documentation for Status and Error Codes different response types are listed for different status codes. For all codes it’s a string in the “errors” field, e.g.:

{
  "errors": "Not Found"
}

Except for 422 where it is a list of strings, e.g.:

{
  "errors": [
    "The fulfillment order is not in an open state."
  ]
}

However, In the more detailed section of the documentation about status codes it says about 422:

The response body provides details in the errors or error parameters.

How do I know when do expect which and what standard can I rely on. Is there a full comprehensive list of all possible error responses somewhere? Dynamically checking for all possibilities is pretty cumbersome and error prone.

2 Likes