Errors
Structure and meaning of error responses.
Every error comes with the matching HTTP status and the content type application/problem+json
following RFC 9457.
{
"type": "https://docs.hfoods.de/en/docs/developers/errors#validation",
"title": "Invalid input",
"status": 422,
"code": "validation_failed",
"detail": "At least one field is invalid.",
"requestId": "req_8f3a2c",
"errors": [
{ "field": "/items/0/quantity", "code": "too_small", "message": "The quantity must be at least 1." }
]
}codeis meant for your program. It never changes within a major version.titleanddetailare meant for humans and may change. Do not parse them.requestIdis also sent in theRequest-Idheader. Include it when you contact support.
Status codes
| Status | Meaning | Retry? |
|---|---|---|
| 400 | The request is malformed. | No, fix it first |
| 401 | Missing or invalid key. | No |
| 403 | The key is not allowed to do this. | No |
| 404 | Not found, or it does not belong to your key. | No |
| 409 | The current state does not allow the action, or the Idempotency-Key was used with a different body. | No |
| 422 | The input is invalid. | No, fix it first |
| 429 | Too many requests. | Yes, after Retry-After seconds |
| 500, 502, 503 | Error on the hfoods side. | Yes, with increasing delays and the same Idempotency-Key |
Validation
With status 422, errors contains one entry per invalid field. field is a JSON Pointer to the
location in your request.