Every failure comes back in the same envelope: type: "error", data: [], and the reasons as an array of strings in message.error with the HTTP status repeated in message.code. One error branch handles the whole API.
{
"message": {
"code": 400,
"error": ["The amount must be a string."]
},
"data": [],
"type": "error"
}{
"message": {
"code": 400,
"error": ["Invalid secret ID"]
},
"data": [],
"type": "error"
}{
"message": {
"code": 403,
"error": ["Requested with invalid token!"]
},
"data": [],
"type": "error"
}